add tests

This commit is contained in:
Gabriela Britto
2019-01-29 16:46:20 -08:00
parent 050c70a4c0
commit 40987ecf41
2 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
/// <reference path='fourslash.ts' />
////function foo(this: void, /*a*/t: string, s: string/*b*/) {
//// return s;
////}
////foo("a", "b");
goTo.select("a", "b");
edit.applyRefactor({
refactorName: "Convert to named parameters",
actionName: "Convert to named parameters",
actionDescription: "Convert to named parameters",
newContent: `function foo(this: void, { t, s }: { t: string; s: string; }) {
return s;
}
foo({ t: "a", s: "b" });`
});

View File

@@ -0,0 +1,24 @@
/// <reference path='fourslash.ts' />
////class Foo {
//// /*a*/bar/*b*/(t: string, s: string): string {
//// return s + t;
//// }
////}
////var foo = {};
////foo['bar']("a", "b");
///
goTo.select("a", "b");
edit.applyRefactor({
refactorName: "Convert to named parameters",
actionName: "Convert to named parameters",
actionDescription: "Convert to named parameters",
newContent: `class Foo {
bar({ t, s }: { t: string; s: string; }): string {
return s + t;
}
}
var foo = {};
foo['bar']("a", "b");`
});