1
+ /// <reference path="fourslash.ts"/>
2
+
3
+ // @Filename : /src/main.ts
4
+ ////import { message } from "./message.js";
5
+ ////
6
+ ////[|export function someLibFn(): string {
7
+ //// return main();
8
+ //// }|]
9
+ ////
10
+ ////function main(): string {
11
+ //// return message;
12
+ //// }
13
+ ////console.log(someLibFn());
14
+
15
+ // @Filename : /message.ts
16
+ ////export const message = "hello world";
17
+
18
+ // @Filename : /other.ts
19
+ ////import { someLibFn } from "./src/main.js";
20
+ ////
21
+ ////function someOtherFn(): string {
22
+ //// return someLibFn();
23
+ //// }
24
+
25
+ // @Filename : /act/action.ts
26
+ ////import { someLibFn } from "../src/main.js";
27
+ ////
28
+ ////function doAction(): string {
29
+ //// return someLibFn();
30
+ //// }
31
+
32
+
33
+ verify . moveToNewFile ( {
34
+ newFileContents : {
35
+ "/src/main.ts" :
36
+ `import { message } from "./message.js";
37
+ import { someLibFn } from "./someLibFn.js";
38
+
39
+ export function main(): string {
40
+ return message;
41
+ }
42
+ console.log(someLibFn());` ,
43
+
44
+ "/src/someLibFn.ts" :
45
+ `import { main } from "./main.js";
46
+
47
+
48
+ export function someLibFn(): string {
49
+ return main();
50
+ }
51
+ ` ,
52
+
53
+ "/other.ts" :
54
+ `import { someLibFn } from "./src/someLibFn.js";
55
+
56
+ function someOtherFn(): string {
57
+ return someLibFn();
58
+ }` ,
59
+
60
+ "/act/action.ts" :
61
+ `import { someLibFn } from "../src/someLibFn.js";
62
+
63
+ function doAction(): string {
64
+ return someLibFn();
65
+ }` ,
66
+ }
67
+ } ) ;
0 commit comments