Skip to content

Commit 4fa90c5

Browse files
committed
Do a pair of server tests early too
1 parent 141bbac commit 4fa90c5

File tree

4 files changed

+121
-104
lines changed

4 files changed

+121
-104
lines changed

src/testRunner/unittests/tsserver/getEditsForFileRename.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ describe("unittests:: tsserver:: getEditsForFileRename::", () => {
2727
};
2828
const tsconfig: File = {
2929
path: "/home/src/projects/project/tsconfig.json",
30-
content: "{}",
30+
content: `{ "compilerOptions": { "module": "commonjs" } }`,
3131
};
3232

3333
const host = TestServerHost.createServerHost([userTs, newTs, tsconfig]);
34-
const options: ts.CompilerOptions = {};
34+
const options: ts.CompilerOptions = { module: ts.ModuleKind.CommonJS };
3535
const moduleResolutionCache = ts.createModuleResolutionCache(host.getCurrentDirectory(), ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames), options);
3636
const lsHost: ts.LanguageServiceHost = {
3737
getCompilationSettings: () => options,

src/testRunner/unittests/tsserver/typingsInstaller.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,6 +2495,7 @@ describe("unittests:: tsserver:: typingsInstaller:: recomputing resolutions of u
24952495
host,
24962496
installAction: typingFiles,
24972497
});
2498+
setCompilerOptionsForInferredProjectsRequestForSession({ module: ts.ModuleKind.CommonJS }, session);
24982499
openFilesForSession([app], session);
24992500

25002501
const proj = session.getProjectService().inferredProjects[0];

tests/baselines/reference/tsserver/typingsInstaller/invalidate-the-resolutions-with-trimmed-names.js

Lines changed: 59 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,33 @@ interface ReadonlyArray<T> {}
2828
declare const console: { log(msg: any): void; };
2929

3030

31+
Info seq [hh:mm:ss:mss] request:
32+
{
33+
"command": "compilerOptionsForInferredProjects",
34+
"arguments": {
35+
"options": {
36+
"module": 1
37+
}
38+
},
39+
"seq": 1,
40+
"type": "request"
41+
}
42+
Info seq [hh:mm:ss:mss] response:
43+
{
44+
"response": true,
45+
"responseRequired": true
46+
}
47+
After request
48+
49+
Before request
50+
3151
Info seq [hh:mm:ss:mss] request:
3252
{
3353
"command": "open",
3454
"arguments": {
3555
"file": "/home/src/projects/project/app.js"
3656
},
37-
"seq": 1,
57+
"seq": 2,
3858
"type": "request"
3959
}
4060
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/projects/project/app.js ProjectRootPath: undefined:: Result: undefined
@@ -169,12 +189,11 @@ TI:: [hh:mm:ss:mss] Got install request
169189
"/home/src/projects/project/app.js"
170190
],
171191
"compilerOptions": {
172-
"target": 1,
173-
"jsx": 1,
192+
"module": 1,
174193
"allowNonTsExtensions": true,
175-
"allowJs": true,
176194
"noEmitForJsFiles": true,
177-
"maxNodeModuleJsDepth": 2
195+
"maxNodeModuleJsDepth": 2,
196+
"allowJs": true
178197
},
179198
"typeAcquisition": {
180199
"enable": true,
@@ -249,7 +268,7 @@ Info seq [hh:mm:ss:mss] response:
249268
"seq": 0,
250269
"type": "response",
251270
"command": "open",
252-
"request_seq": 1,
271+
"request_seq": 2,
253272
"success": true,
254273
"performanceData": {
255274
"updateGraphDurationMs": *
@@ -340,12 +359,11 @@ TI:: [hh:mm:ss:mss] Sending response:
340359
"exclude": []
341360
},
342361
"compilerOptions": {
343-
"target": 1,
344-
"jsx": 1,
362+
"module": 1,
345363
"allowNonTsExtensions": true,
346-
"allowJs": true,
347364
"noEmitForJsFiles": true,
348-
"maxNodeModuleJsDepth": 2
365+
"maxNodeModuleJsDepth": 2,
366+
"allowJs": true
349367
},
350368
"typings": [
351369
"/home/src/Library/Caches/typescript/node_modules/foo/index.d.ts"
@@ -370,12 +388,11 @@ Info seq [hh:mm:ss:mss] event:
370388
"exclude": []
371389
},
372390
"compilerOptions": {
373-
"target": 1,
374-
"jsx": 1,
391+
"module": 1,
375392
"allowNonTsExtensions": true,
376-
"allowJs": true,
377393
"noEmitForJsFiles": true,
378-
"maxNodeModuleJsDepth": 2
394+
"maxNodeModuleJsDepth": 2,
395+
"allowJs": true
379396
},
380397
"typings": [
381398
"/home/src/Library/Caches/typescript/node_modules/foo/index.d.ts"
@@ -472,12 +489,11 @@ TI:: [hh:mm:ss:mss] Got install request
472489
"/home/src/Library/Caches/typescript/node_modules/foo/index.d.ts"
473490
],
474491
"compilerOptions": {
475-
"target": 1,
476-
"jsx": 1,
492+
"module": 1,
477493
"allowNonTsExtensions": true,
478-
"allowJs": true,
479494
"noEmitForJsFiles": true,
480-
"maxNodeModuleJsDepth": 2
495+
"maxNodeModuleJsDepth": 2,
496+
"allowJs": true
481497
},
482498
"typeAcquisition": {
483499
"enable": true,
@@ -515,12 +531,11 @@ TI:: [hh:mm:ss:mss] Sending response:
515531
"exclude": []
516532
},
517533
"compilerOptions": {
518-
"target": 1,
519-
"jsx": 1,
534+
"module": 1,
520535
"allowNonTsExtensions": true,
521-
"allowJs": true,
522536
"noEmitForJsFiles": true,
523-
"maxNodeModuleJsDepth": 2
537+
"maxNodeModuleJsDepth": 2,
538+
"allowJs": true
524539
},
525540
"typings": [],
526541
"unresolvedImports": [],
@@ -541,12 +556,11 @@ Info seq [hh:mm:ss:mss] event:
541556
"exclude": []
542557
},
543558
"compilerOptions": {
544-
"target": 1,
545-
"jsx": 1,
559+
"module": 1,
546560
"allowNonTsExtensions": true,
547-
"allowJs": true,
548561
"noEmitForJsFiles": true,
549-
"maxNodeModuleJsDepth": 2
562+
"maxNodeModuleJsDepth": 2,
563+
"allowJs": true
550564
},
551565
"typings": [],
552566
"unresolvedImports": [],
@@ -675,12 +689,11 @@ TI:: [hh:mm:ss:mss] Got install request
675689
"/home/src/projects/project/app.js"
676690
],
677691
"compilerOptions": {
678-
"target": 1,
679-
"jsx": 1,
692+
"module": 1,
680693
"allowNonTsExtensions": true,
681-
"allowJs": true,
682694
"noEmitForJsFiles": true,
683-
"maxNodeModuleJsDepth": 2
695+
"maxNodeModuleJsDepth": 2,
696+
"allowJs": true
684697
},
685698
"typeAcquisition": {
686699
"enable": true,
@@ -718,12 +731,11 @@ TI:: [hh:mm:ss:mss] Sending response:
718731
"exclude": []
719732
},
720733
"compilerOptions": {
721-
"target": 1,
722-
"jsx": 1,
734+
"module": 1,
723735
"allowNonTsExtensions": true,
724-
"allowJs": true,
725736
"noEmitForJsFiles": true,
726-
"maxNodeModuleJsDepth": 2
737+
"maxNodeModuleJsDepth": 2,
738+
"allowJs": true
727739
},
728740
"typings": [],
729741
"unresolvedImports": [],
@@ -742,12 +754,11 @@ Info seq [hh:mm:ss:mss] event:
742754
"exclude": []
743755
},
744756
"compilerOptions": {
745-
"target": 1,
746-
"jsx": 1,
757+
"module": 1,
747758
"allowNonTsExtensions": true,
748-
"allowJs": true,
749759
"noEmitForJsFiles": true,
750-
"maxNodeModuleJsDepth": 2
760+
"maxNodeModuleJsDepth": 2,
761+
"allowJs": true
751762
},
752763
"typings": [],
753764
"unresolvedImports": [],
@@ -788,7 +799,7 @@ Info seq [hh:mm:ss:mss] request:
788799
}
789800
]
790801
},
791-
"seq": 2,
802+
"seq": 3,
792803
"type": "request"
793804
}
794805
Info seq [hh:mm:ss:mss] response:
@@ -858,12 +869,11 @@ TI:: [hh:mm:ss:mss] Got install request
858869
"/home/src/projects/project/app.js"
859870
],
860871
"compilerOptions": {
861-
"target": 1,
862-
"jsx": 1,
872+
"module": 1,
863873
"allowNonTsExtensions": true,
864-
"allowJs": true,
865874
"noEmitForJsFiles": true,
866-
"maxNodeModuleJsDepth": 2
875+
"maxNodeModuleJsDepth": 2,
876+
"allowJs": true
867877
},
868878
"typeAcquisition": {
869879
"enable": true,
@@ -908,12 +918,11 @@ TI:: [hh:mm:ss:mss] Sending response:
908918
"exclude": []
909919
},
910920
"compilerOptions": {
911-
"target": 1,
912-
"jsx": 1,
921+
"module": 1,
913922
"allowNonTsExtensions": true,
914-
"allowJs": true,
915923
"noEmitForJsFiles": true,
916-
"maxNodeModuleJsDepth": 2
924+
"maxNodeModuleJsDepth": 2,
925+
"allowJs": true
917926
},
918927
"typings": [],
919928
"unresolvedImports": [
@@ -934,12 +943,11 @@ Info seq [hh:mm:ss:mss] event:
934943
"exclude": []
935944
},
936945
"compilerOptions": {
937-
"target": 1,
938-
"jsx": 1,
946+
"module": 1,
939947
"allowNonTsExtensions": true,
940-
"allowJs": true,
941948
"noEmitForJsFiles": true,
942-
"maxNodeModuleJsDepth": 2
949+
"maxNodeModuleJsDepth": 2,
950+
"allowJs": true
943951
},
944952
"typings": [],
945953
"unresolvedImports": [

0 commit comments

Comments
 (0)