TypeScript/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_Typed.ts

14 lines
424 B
TypeScript
Raw Normal View History

/// <reference path='fourslash.ts' />
2018-11-09 09:51:51 +01:00
//// const increment = /*x*/(/*y*/a: number): number => a + 1;
goTo.select("x", "y");
edit.applyRefactor({
refactorName: "Convert arrow function or function expression",
actionName: "Convert to anonymous function",
actionDescription: "Convert to anonymous function",
2018-11-09 09:51:51 +01:00
newContent: `const increment = function(a: number): number {
return a + 1;
};`,
});