@@ -44,6 +44,8 @@ namespace ts.projectSystem {
44
44
} ) ;
45
45
}
46
46
47
+ import typingsName = server . typingsInstaller . typingsName ;
48
+
47
49
describe ( "typingsInstaller" , ( ) => {
48
50
it ( "configured projects (typings installed) 1" , ( ) => {
49
51
const file1 = {
@@ -519,32 +521,32 @@ namespace ts.projectSystem {
519
521
const commander = {
520
522
path : "/a/data/node_modules/@types/commander/index.d.ts" ,
521
523
content : "declare const commander: { x: number }" ,
522
- typings : "@types/ commander"
524
+ typings : typingsName ( " commander")
523
525
} ;
524
526
const jquery = {
525
527
path : "/a/data/node_modules/@types/jquery/index.d.ts" ,
526
528
content : "declare const jquery: { x: number }" ,
527
- typings : "@types/ jquery"
529
+ typings : typingsName ( " jquery")
528
530
} ;
529
531
const lodash = {
530
532
path : "/a/data/node_modules/@types/lodash/index.d.ts" ,
531
533
content : "declare const lodash: { x: number }" ,
532
- typings : "@types/ lodash"
534
+ typings : typingsName ( " lodash")
533
535
} ;
534
536
const cordova = {
535
537
path : "/a/data/node_modules/@types/cordova/index.d.ts" ,
536
538
content : "declare const cordova: { x: number }" ,
537
- typings : "@types/ cordova"
539
+ typings : typingsName ( " cordova")
538
540
} ;
539
541
const grunt = {
540
542
path : "/a/data/node_modules/@types/grunt/index.d.ts" ,
541
543
content : "declare const grunt: { x: number }" ,
542
- typings : "@types/ grunt"
544
+ typings : typingsName ( " grunt")
543
545
} ;
544
546
const gulp = {
545
547
path : "/a/data/node_modules/@types/gulp/index.d.ts" ,
546
548
content : "declare const gulp: { x: number }" ,
547
- typings : "@types/ gulp"
549
+ typings : typingsName ( " gulp")
548
550
} ;
549
551
550
552
const host = createServerHost ( [ lodashJs , commanderJs , file3 ] ) ;
@@ -554,7 +556,7 @@ namespace ts.projectSystem {
554
556
}
555
557
installWorker ( _requestId : number , args : string [ ] , _cwd : string , cb : TI . RequestCompletedAction ) : void {
556
558
let typingFiles : ( FileOrFolder & { typings : string } ) [ ] = [ ] ;
557
- if ( args . indexOf ( "@types/ commander") >= 0 ) {
559
+ if ( args . indexOf ( typingsName ( " commander") ) >= 0 ) {
558
560
typingFiles = [ commander , jquery , lodash , cordova ] ;
559
561
}
560
562
else {
@@ -982,7 +984,7 @@ namespace ts.projectSystem {
982
984
return ;
983
985
}
984
986
if ( response . kind === server . EventEndInstallTypes ) {
985
- assert . deepEqual ( response . packagesToInstall , [ "@types/ commander"] ) ;
987
+ assert . deepEqual ( response . packagesToInstall , [ typingsName ( " commander") ] ) ;
986
988
seenTelemetryEvent = true ;
987
989
return ;
988
990
}
0 commit comments