Skip to content

Commit c9f8d90

Browse files
committed
Update the test
1 parent 711e890 commit c9f8d90

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

src/harness/unittests/tsserverProjectSystem.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,18 +2345,36 @@ namespace ts.projectSystem {
23452345
const projectFileName = "/user/someuser/project/WebApplication6.csproj";
23462346
const host = createServerHost([libFile, site, configFile]);
23472347
const projectService = createProjectService(host);
2348-
projectService.openExternalProjects([{
2348+
2349+
const externalProject: protocol.ExternalProject = {
23492350
projectFileName,
2350-
rootFiles: [toExternalFile(configFile.path), toExternalFile(site.path)],
2351-
options: { "allowJs": false, "allowNonTsExtensions": false, "allowSyntheticDefaultImports": false, "allowUnreachableCode": false, "allowUnusedLabels": false, "alwaysStrict": false, "compileOnSave": true, "declaration": false, "emitBOM": false, "emitDecoratorMetadata": false, "experimentalAsyncFunctions": false, "experimentalDecorators": false, "forceConsistentCasingInFileNames": false, "importHelpers": false, "inlineSourceMap": false, "inlineSources": false, "isolatedModules": false, "jsx": 0, "noEmit": false, "noEmitHelpers": false, "noEmitOnError": true, "noFallthroughCasesInSwitch": false, "noImplicitAny": false, "noImplicitReturns": false, "noImplicitThis": false, "noImplicitUseStrict": false, "noLib": false, "noResolve": false, "noUnusedLocals": false, "noUnusedParameters": false, "preserveConstEnums": false, "removeComments": false, "skipDefaultLibCheck": false, "skipLibCheck": false, "sourceMap": true, "strictNullChecks": false, "stripInternal": false, "suppressExcessPropertyErrors": false, "suppressImplicitAnyIndexErrors": false, "target": 1 },
2351+
rootFiles: [toExternalFile(site.path), toExternalFile(configFile.path)],
2352+
options: { allowJs: false },
23522353
typeAcquisition: { "include": [] }
2353-
}]);
2354+
};
2355+
2356+
projectService.openExternalProjects([externalProject]);
23542357

23552358
let knownProjects = projectService.synchronizeProjectList([]);
2359+
checkNumberOfProjects(projectService, { configuredProjects: 1, externalProjects: 0, inferredProjects: 0 });
2360+
2361+
const configProject = projectService.configuredProjects[0];
2362+
checkProjectActualFiles(configProject, [libFile.path]);
2363+
2364+
const diagnostics = configProject.getProjectErrors();
2365+
assert.equal(diagnostics[0].code, Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code);
2366+
23562367
host.reloadFS([libFile, site]);
23572368
host.triggerFileWatcherCallback(configFile.path);
23582369

23592370
knownProjects = projectService.synchronizeProjectList(map(knownProjects, proj => proj.info));
2371+
checkNumberOfProjects(projectService, { configuredProjects: 0, externalProjects: 0, inferredProjects: 0 });
2372+
2373+
externalProject.rootFiles.length = 1;
2374+
projectService.openExternalProjects([externalProject]);
2375+
2376+
checkNumberOfProjects(projectService, { configuredProjects: 0, externalProjects: 1, inferredProjects: 0 });
2377+
checkProjectActualFiles(projectService.externalProjects[0], [site.path, libFile.path]);
23602378
});
23612379
});
23622380

0 commit comments

Comments
 (0)