@@ -692,7 +692,53 @@ namespace ts.projectSystem {
692
692
checkProjectActualFiles ( p , [ app . path , jqueryDTS . path ] ) ;
693
693
} ) ;
694
694
695
- it ( "configured projects discover from bower.josn" , ( ) => {
695
+ it ( "configured projects discover from bower_components" , ( ) => {
696
+ const app = {
697
+ path : "/app.js" ,
698
+ content : ""
699
+ } ;
700
+ const jsconfig = {
701
+ path : "/jsconfig.json" ,
702
+ content : JSON . stringify ( { } )
703
+ } ;
704
+ const jquery = {
705
+ path : "/bower_components/jquery/index.js" ,
706
+ content : ""
707
+ } ;
708
+ const jqueryPackage = {
709
+ path : "/bower_components/jquery/package.json" ,
710
+ content : JSON . stringify ( { name : "jquery" } )
711
+ } ;
712
+ const jqueryDTS = {
713
+ path : "/tmp/node_modules/@types/jquery/index.d.ts" ,
714
+ content : ""
715
+ } ;
716
+ const host = createServerHost ( [ app , jsconfig , jquery , jqueryPackage ] ) ;
717
+ const installer = new ( class extends Installer {
718
+ constructor ( ) {
719
+ super ( host , { globalTypingsCacheLocation : "/tmp" , typesRegistry : createTypesRegistry ( "jquery" ) } ) ;
720
+ }
721
+ installWorker ( _requestId : number , _args : string [ ] , _cwd : string , cb : server . typingsInstaller . RequestCompletedAction ) {
722
+ const installedTypings = [ "@types/jquery" ] ;
723
+ const typingFiles = [ jqueryDTS ] ;
724
+ executeCommand ( this , host , installedTypings , typingFiles , cb ) ;
725
+ }
726
+ } ) ( ) ;
727
+
728
+ const projectService = createProjectService ( host , { useSingleInferredProject : true , typingsInstaller : installer } ) ;
729
+ projectService . openClientFile ( app . path ) ;
730
+
731
+ checkNumberOfProjects ( projectService , { configuredProjects : 1 } ) ;
732
+ const p = projectService . configuredProjects [ 0 ] ;
733
+ checkProjectActualFiles ( p , [ app . path ] ) ;
734
+
735
+ installer . installAll ( /*expectedCount*/ 1 ) ;
736
+
737
+ checkNumberOfProjects ( projectService , { configuredProjects : 1 } ) ;
738
+ checkProjectActualFiles ( p , [ app . path , jqueryDTS . path ] ) ;
739
+ } ) ;
740
+
741
+ it ( "configured projects discover from bower.json" , ( ) => {
696
742
const app = {
697
743
path : "/app.js" ,
698
744
content : ""
@@ -975,7 +1021,7 @@ namespace ts.projectSystem {
975
1021
}
976
1022
} ) ;
977
1023
978
- it ( "should use cached locaitons " , ( ) => {
1024
+ it ( "should use cached locations " , ( ) => {
979
1025
const f = {
980
1026
path : "/a/b/app.js" ,
981
1027
content : ""
0 commit comments