fix(language-service): reset MockHost after every spec instead of creating new LS (#33200)

This commit speeds up the tests by calling `MockHost.reset()` in
`beforeEach()` instead of destroying the entire language service and
creating a new one. The creation of a new language service instance is
expensive due to the need to initialize many core Symbols when creating
a new program.

This speeds ups the test (on my local machine) from 35 secs to 15 secs.

PR Close #33200
This commit is contained in:
Keen Yee Liau
2019-10-16 12:00:41 -07:00
committed by Matias Niemelä
parent 43241a560a
commit 11bf7679a1
6 changed files with 27 additions and 62 deletions

View File

@ -13,7 +13,6 @@ ts_library(
"//packages/compiler",
"//packages/compiler-cli/test:test_utils",
"//packages/language-service",
"@npm//reflect-metadata",
"@npm//typescript",
],
)