TypeScript/tests/cases/fourslash/extract-method21.ts

30 lines
646 B
TypeScript
Raw Normal View History

2017-08-05 01:10:33 +02:00
/// <reference path='fourslash.ts' />
// Extracting from a static method should create a static method
//// class Foo {
//// static method() {
//// /*start*/return 1;/*end*/
//// }
//// }
goTo.select('start', 'end')
verify.refactorAvailable('Extract Symbol', 'function_scope_1');
2017-08-05 01:10:33 +02:00
edit.applyRefactor({
refactorName: "Extract Symbol",
actionName: "function_scope_1",
actionDescription: "Extract to method in class 'Foo'",
newContent:
`class Foo {
2017-08-05 01:10:33 +02:00
static method() {
return Foo./*RENAME*/newMethod();
2017-08-05 01:10:33 +02:00
}
private static newMethod() {
2017-08-05 01:10:33 +02:00
return 1;
}
}`
});