Skip to content

Commit

Permalink
fix(compiler): only exclude test files when initializing compiler (#2062
Browse files Browse the repository at this point in the history
)

Closes #2061
  • Loading branch information
ahnpnl committed Oct 26, 2020
1 parent 78502e1 commit 7264c13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions e2e/__external-repos__/custom-typings/__tests__/index.test.ts
@@ -1,9 +1,13 @@
import $ from "jquery"

function foo() {
$.ajax<number>("/foo")
}

test("foo", () => {
test('foo', () => {
expect(2).toBe(2)
})

test('bar', () => {
const terminateReason: TerminatedReason = 'culled'

expect(terminateReason).toEqual('culled')
})
1 change: 1 addition & 0 deletions e2e/__external-repos__/custom-typings/global.ts
@@ -0,0 +1 @@
type TerminatedReason = 'culled' | 'died' | 'transferred'
2 changes: 1 addition & 1 deletion src/compiler/language-service.ts
Expand Up @@ -75,7 +75,7 @@ export const initializeLanguageServiceInstance = (configs: ConfigSet, logger: Lo
}
// Initialize memory cache for typescript compiler
configs.parsedTsConfig.fileNames
.filter((fileName) => fileName.endsWith('.d.ts'))
.filter((fileName) => !configs.isTestFile(fileName))
.forEach((fileName) => {
memoryCache.files.set(fileName, {
version: 0,
Expand Down

0 comments on commit 7264c13

Please sign in to comment.