From 4029e70c97070a5b8adfe3cc154d3fc35e9dda39 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 16 Jan 2019 19:24:11 -0800 Subject: [PATCH] Illustrate a case that isn't handled correctly --- .../fourslash/moveToNewFile_moveJsxImport4.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/cases/fourslash/moveToNewFile_moveJsxImport4.ts diff --git a/tests/cases/fourslash/moveToNewFile_moveJsxImport4.ts b/tests/cases/fourslash/moveToNewFile_moveJsxImport4.ts new file mode 100644 index 00000000000..b5179f66a45 --- /dev/null +++ b/tests/cases/fourslash/moveToNewFile_moveJsxImport4.ts @@ -0,0 +1,29 @@ +/// + +// @jsx: preserve +// @noLib: true +// @libFiles: react.d.ts,lib.d.ts,leftpad.d.ts + +// @Filename: file.tsx +//// import React = require('leftpad'); +//// [|function F() { +//// const React = import("react"); +////
; +//// }|] +//// React; + +verify.moveToNewFile({ + newFileContents: { + "/tests/cases/fourslash/file.tsx": +`import React = require('leftpad'); +React;`, + // NB: A perfect implementation would not copy over the import + "/tests/cases/fourslash/F.tsx": +`import React = require('leftpad'); +function F() { + const React = import("react"); +
; +} +`, + } +});