@@ -692,7 +692,54 @@ 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
+ checkWatchedFiles ( host , [ jsconfig . path , "/bower_components" , "/node_modules" ] ) ;
735
+
736
+ installer . installAll ( /*expectedCount*/ 1 ) ;
737
+
738
+ checkNumberOfProjects ( projectService , { configuredProjects : 1 } ) ;
739
+ checkProjectActualFiles ( p , [ app . path , jqueryDTS . path ] ) ;
740
+ } ) ;
741
+
742
+ it ( "configured projects discover from bower.json" , ( ) => {
696
743
const app = {
697
744
path : "/app.js" ,
698
745
content : ""
@@ -975,7 +1022,7 @@ namespace ts.projectSystem {
975
1022
}
976
1023
} ) ;
977
1024
978
- it ( "should use cached locaitons " , ( ) => {
1025
+ it ( "should use cached locations " , ( ) => {
979
1026
const f = {
980
1027
path : "/a/b/app.js" ,
981
1028
content : ""
0 commit comments