@@ -46,6 +46,45 @@ namespace ts.projectSystem {
46
46
47
47
import typingsName = server . typingsInstaller . typingsName ;
48
48
49
+ describe ( "local module" , ( ) => {
50
+ it ( "should not be picked up" , ( ) => {
51
+ const f1 = {
52
+ path : "/a/app.js" ,
53
+ content : "const c = require('./config');"
54
+ } ;
55
+ const f2 = {
56
+ path : "/a/config.js" ,
57
+ content : "export let x = 1"
58
+ } ;
59
+ const typesCache = "/cache"
60
+ const typesConfig = {
61
+ path : typesCache + "/node_modules/@types/config/index.d.ts" ,
62
+ content : "export let y: number;"
63
+ } ;
64
+ const config = {
65
+ path : "/a/jsconfig.json" ,
66
+ content : JSON . stringify ( {
67
+ compilerOptions : { moduleResolution : "commonjs" } ,
68
+ typeAcquisition : { enable : true }
69
+ } )
70
+ } ;
71
+ const host = createServerHost ( [ f1 , f2 , config , typesConfig ] ) ;
72
+ const installer = new ( class extends Installer {
73
+ constructor ( ) {
74
+ super ( host , { typesRegistry : createTypesRegistry ( "config" ) , globalTypingsCacheLocation : typesCache } ) ;
75
+ }
76
+ installWorker ( _requestId : number , _args : string [ ] , _cwd : string , _cb : server . typingsInstaller . RequestCompletedAction ) {
77
+ assert ( false , "should not be called" )
78
+ }
79
+ } ) ( ) ;
80
+ const service = createProjectService ( host , { typingsInstaller : installer } ) ;
81
+ service . openClientFile ( f1 . path ) ;
82
+ service . checkNumberOfProjects ( { configuredProjects : 1 } ) ;
83
+ checkProjectActualFiles ( service . configuredProjects [ 0 ] , [ f1 . path , f2 . path ] ) ;
84
+ installer . installAll ( 0 ) ;
85
+ } ) ;
86
+ } ) ;
87
+
49
88
describe ( "typingsInstaller" , ( ) => {
50
89
it ( "configured projects (typings installed) 1" , ( ) => {
51
90
const file1 = {
0 commit comments