This reverts commit 1b21350e1719428b8d0c3280add470d1b395e2af. PR Close #39322
This commit is contained in:
parent
d30911c4eb
commit
726c5ef679
@ -68,12 +68,6 @@ export const host: ts.server.ServerHost = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructing a project service is expensive (~2.5s on MacBook Pro), so it
|
|
||||||
* should be a singleton service shared throughout all tests.
|
|
||||||
*/
|
|
||||||
let projectService: ts.server.ProjectService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a ConfiguredProject and an actual program for the test project located
|
* Create a ConfiguredProject and an actual program for the test project located
|
||||||
* in packages/language-service/test/project. Project creation exercises the
|
* in packages/language-service/test/project. Project creation exercises the
|
||||||
@ -81,8 +75,7 @@ let projectService: ts.server.ProjectService;
|
|||||||
* and modify test files.
|
* and modify test files.
|
||||||
*/
|
*/
|
||||||
export function setup() {
|
export function setup() {
|
||||||
if (!projectService) {
|
const projectService = new ts.server.ProjectService({
|
||||||
projectService = new ts.server.ProjectService({
|
|
||||||
host,
|
host,
|
||||||
logger,
|
logger,
|
||||||
cancellationToken: ts.server.nullCancellationToken,
|
cancellationToken: ts.server.nullCancellationToken,
|
||||||
@ -93,7 +86,6 @@ export function setup() {
|
|||||||
// Opening APP_COMPONENT forces a new ConfiguredProject to be created based
|
// Opening APP_COMPONENT forces a new ConfiguredProject to be created based
|
||||||
// on the tsconfig.json in the test project.
|
// on the tsconfig.json in the test project.
|
||||||
projectService.openClientFile(APP_COMPONENT);
|
projectService.openClientFile(APP_COMPONENT);
|
||||||
}
|
|
||||||
const project = projectService.findProject(TSCONFIG);
|
const project = projectService.findProject(TSCONFIG);
|
||||||
if (!project) {
|
if (!project) {
|
||||||
throw new Error(`Failed to create project for ${TSCONFIG}`);
|
throw new Error(`Failed to create project for ${TSCONFIG}`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user