@@ -2183,7 +2183,7 @@ namespace ts {
21832183 for ( let i = 0 ; i < errors . length ; i ++ ) {
21842184 const actualMessage = flattenDiagnosticMessageText ( errors [ i ] . messageText , "\n" ) ;
21852185 const expectedMessage = expectedErrors [ i ] ;
2186- assert . equal ( actualMessage , expectedMessage , " error message does not match" ) ;
2186+ assert . isTrue ( actualMessage . indexOf ( expectedMessage ) === 0 , ` error message does not match, expected ${ actualMessage } to start with ${ expectedMessage } ` ) ;
21872187 }
21882188 }
21892189 }
@@ -2297,7 +2297,7 @@ namespace ts {
22972297 "')' expected." ,
22982298 "Declaration or statement expected." ,
22992299 "Declaration or statement expected." ,
2300- "Failed to parse file '/a/b/tsconfig.json': Unexpected token ) in JSON at position 7. "
2300+ "Failed to parse file '/a/b/tsconfig.json'"
23012301 ] ) ;
23022302 }
23032303 // fix config and trigger watcher
@@ -2349,7 +2349,7 @@ namespace ts {
23492349 "')' expected." ,
23502350 "Declaration or statement expected." ,
23512351 "Declaration or statement expected." ,
2352- "Failed to parse file '/a/b/tsconfig.json': Unexpected token ) in JSON at position 7. "
2352+ "Failed to parse file '/a/b/tsconfig.json'"
23532353 ] ) ;
23542354 }
23552355 } ) ;
@@ -2375,4 +2375,27 @@ namespace ts {
23752375 checkProjectRootFiles ( project , [ file1 . path ] ) ;
23762376 } ) ;
23772377 } ) ;
2378+
2379+ describe ( "autoDiscovery" , ( ) => {
2380+ it ( "does not depend on extension" , ( ) => {
2381+ const file1 = {
2382+ path : "/a/b/app.html" ,
2383+ content : ""
2384+ } ;
2385+ const file2 = {
2386+ path : "/a/b/app.d.ts" ,
2387+ content : ""
2388+ } ;
2389+ const host = createServerHost ( [ file1 , file2 ] ) ;
2390+ const projectService = createProjectService ( host ) ;
2391+ projectService . openExternalProject ( {
2392+ projectFileName : "/a/b/proj.csproj" ,
2393+ rootFiles : [ toExternalFile ( file2 . path ) , { fileName : file1 . path , hasMixedContent : true , scriptKind : ScriptKind . JS } ] ,
2394+ options : { }
2395+ } ) ;
2396+ projectService . checkNumberOfProjects ( { externalProjects : 1 } ) ;
2397+ const typingOptions = projectService . externalProjects [ 0 ] . getTypingOptions ( ) ;
2398+ assert . isTrue ( typingOptions . enableAutoDiscovery , "Typing autodiscovery should be enabled" ) ;
2399+ } ) ;
2400+ } ) ;
23782401}
0 commit comments