From 8c4ab69d09c9da1bb89dea46e2b31c6a846ae980 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Mon, 4 Mar 2019 09:34:04 -0800 Subject: [PATCH] add test for non-transient symbol --- ...onvertToNamedParameters_methodCallUnion.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/cases/fourslash/refactorConvertToNamedParameters_methodCallUnion.ts diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_methodCallUnion.ts b/tests/cases/fourslash/refactorConvertToNamedParameters_methodCallUnion.ts new file mode 100644 index 00000000000..e4cafbeff3e --- /dev/null +++ b/tests/cases/fourslash/refactorConvertToNamedParameters_methodCallUnion.ts @@ -0,0 +1,29 @@ +/// + +////class A { +//// /*a*/foo/*b*/(a: number, b: number) { return a + b; } +////} +////class B { +//// foo(c: number, d: number) { return c + d; } +////} +////function foo(ab: A | B) { +//// return ab.foo(1, 2); +////} + + +goTo.select("a", "b"); +// Refactor should not make changes +edit.applyRefactor({ + refactorName: "Convert to named parameters", + actionName: "Convert to named parameters", + actionDescription: "Convert to named parameters", + newContent: `class A { + foo(a: number, b: number) { return a + b; } +} +class B { + foo(c: number, d: number) { return c + d; } +} +function foo(ab: A | B) { + return ab.foo(1, 2); +}` +}); \ No newline at end of file