Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import.meta not allowed #1174

Closed
ejmartin504 opened this issue Aug 14, 2019 · 45 comments
Closed

import.meta not allowed #1174

ejmartin504 opened this issue Aug 14, 2019 · 45 comments

Comments

@ejmartin504
Copy link

ejmartin504 commented Aug 14, 2019

Issue :

In a node project, I'm using import.meta.url to get __dirname like so:

const dirname = path.dirname(new URL(import.meta.url).pathname);

my tsconfig:

{
  "compilerOptions": {
    "baseUrl": "lib",
    "declaration": true,
    "esModuleInterop": true,
    "module": "ESNext",
    "moduleResolution": "node",
    "outDir": "dist",
    "strict": true,
    "target": "ESNext"
  }
}

Running tsc gives me no issues, but running jest results in this error:

The 'import.meta' meta-property is only allowed using 'ESNext' for the 'target' and 'module' compiler options.

I have tried a few different places for the tsconfig and have even tried to use a separate config for ts-jest, but I get this error every time.

Expected behavior :

Normal compilation and successful test.

Debug log:

log file content
# content of ts-jest.log :
{"context":{"logLevel":20,"namespace":"Importer","package":"ts-jest","version":"24.0.2"},"message":"creating Importer singleton","sequence":1,"time":"2019-08-14T20:04:06.329Z"}
{"context":{"allowJs":false,"logLevel":20,"namespace":"jest-preset","package":"ts-jest","version":"24.0.2"},"message":"creating jest presets not handling JavaScript files","sequence":2,"time":"2019-08-14T20:04:06.336Z"}
{"context":{"actualVersion":"24.8.0","expectedVersion":">=24 <25","logLevel":20,"namespace":"versions","package":"ts-jest","version":"24.0.2"},"message":"checking version of jest: OK","sequence":3,"time":"2019-08-14T20:04:06.339Z"}
{"context":{"baseOptions":{},"logLevel":20,"namespace":"jest-transformer","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"created new transformer","sequence":4,"time":"2019-08-14T20:04:06.339Z"}
{"context":{"fileName":"/users/teddy/project/lib/language/__tests__/index.test.ts","logLevel":20,"namespace":"jest-transformer","package":"ts-jest","transformOptions":{"config":{"automock":false,"browser":false,"cache":true,"cacheDirectory":"/private/var/folders/25/8lt2lnwj66qc3f54hwylfy5m0000gn/T/jest_dx","clearMocks":false,"coveragePathIgnorePatterns":["/node_modules/"],"cwd":"/users/teddy/project","dependencyExtractor":null,"detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"filter":null,"forceCoverageMatch":[],"globalSetup":null,"globalTeardown":null,"globals":{},"haste":{"computeSha1":false,"providesModuleNodeModules":[],"throwOnModuleCollision":false},"moduleDirectories":["node_modules"],"moduleFileExtensions":["js","json","jsx","ts","tsx","node"],"moduleNameMapper":{},"modulePathIgnorePatterns":[".yarn_cache"],"name":"daa62f0157dd9296f5160a0bf13f5a4c","prettierPath":"prettier","resetMocks":false,"resetModules":false,"resolver":null,"restoreMocks":false,"rootDir":"/users/teddy/project","roots":["/users/teddy/project"],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"snapshotSerializers":[],"testEnvironment":"/users/teddy/project/node_modules/jest-environment-node/build/index.js","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":["**/__tests__/**/*.[jt]s?(x)","**/?(*.)+(spec|test).[tj]s?(x)"],"testPathIgnorePatterns":["/dist/"],"testRegex":[],"testRunner":"/users/teddy/project/node_modules/jest-jasmine2/build/index.js","testURL":"http://localhost","timers":"fake","transform":[["^.+\\.ts?$","/users/teddy/project/node_modules/ts-jest/dist/index.js"]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"instrument":false,"rootDir":"/users/teddy/project"},"transformerId":1,"version":"24.0.2"},"message":"computing cache key for /users/teddy/project/lib/language/__tests__/index.test.ts","sequence":5,"time":"2019-08-14T20:04:06.339Z"}
{"context":{"logLevel":30,"namespace":"jest-transformer","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"no matching config-set found, creating a new one","sequence":6,"time":"2019-08-14T20:04:06.340Z"}
{"context":{"config":{"automock":false,"browser":false,"cache":true,"cacheDirectory":"/private/var/folders/25/8lt2lnwj66qc3f54hwylfy5m0000gn/T/jest_dx","clearMocks":false,"coveragePathIgnorePatterns":["/node_modules/"],"cwd":"/users/teddy/project","dependencyExtractor":null,"detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"filter":null,"forceCoverageMatch":[],"globalSetup":null,"globalTeardown":null,"globals":{},"haste":{"computeSha1":false,"providesModuleNodeModules":[],"throwOnModuleCollision":false},"moduleDirectories":["node_modules"],"moduleFileExtensions":["js","json","jsx","ts","tsx","node"],"moduleNameMapper":{},"modulePathIgnorePatterns":[".yarn_cache"],"name":"daa62f0157dd9296f5160a0bf13f5a4c","prettierPath":"prettier","resetMocks":false,"resetModules":false,"resolver":null,"restoreMocks":false,"rootDir":"/users/teddy/project","roots":["/users/teddy/project"],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"snapshotSerializers":[],"testEnvironment":"/users/teddy/project/node_modules/jest-environment-node/build/index.js","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":["**/__tests__/**/*.[jt]s?(x)","**/?(*.)+(spec|test).[tj]s?(x)"],"testPathIgnorePatterns":["/dist/"],"testRegex":[],"testRunner":"/users/teddy/project/node_modules/jest-jasmine2/build/index.js","testURL":"http://localhost","timers":"fake","transform":[["^.+\\.ts?$","/users/teddy/project/node_modules/ts-jest/dist/index.js"]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"logLevel":20,"namespace":"backports","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"backporting config","sequence":7,"time":"2019-08-14T20:04:06.340Z"}
{"context":{"jestConfig":{"automock":false,"browser":false,"cache":true,"cacheDirectory":"/private/var/folders/25/8lt2lnwj66qc3f54hwylfy5m0000gn/T/jest_dx","clearMocks":false,"coveragePathIgnorePatterns":["/node_modules/"],"cwd":"/users/teddy/project","dependencyExtractor":null,"detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"filter":null,"forceCoverageMatch":[],"globalSetup":null,"globalTeardown":null,"globals":{"ts-jest":{}},"haste":{"computeSha1":false,"providesModuleNodeModules":[],"throwOnModuleCollision":false},"moduleDirectories":["node_modules"],"moduleFileExtensions":["js","json","jsx","ts","tsx","node"],"moduleNameMapper":{},"modulePathIgnorePatterns":[".yarn_cache"],"name":"daa62f0157dd9296f5160a0bf13f5a4c","prettierPath":"prettier","resetMocks":false,"resetModules":false,"resolver":null,"restoreMocks":false,"rootDir":"/users/teddy/project","roots":["/users/teddy/project"],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"snapshotSerializers":[],"testEnvironment":"/users/teddy/project/node_modules/jest-environment-node/build/index.js","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":["**/__tests__/**/*.[jt]s?(x)","**/?(*.)+(spec|test).[tj]s?(x)"],"testPathIgnorePatterns":["/dist/"],"testRegex":[],"testRunner":"/users/teddy/project/node_modules/jest-jasmine2/build/index.js","testURL":"http://localhost","timers":"fake","transform":[["^.+\\.ts?$","/users/teddy/project/node_modules/ts-jest/dist/index.js"]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"logLevel":20,"namespace":"config","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"normalized jest config","sequence":8,"time":"2019-08-14T20:04:06.340Z"}
{"context":{"logLevel":20,"namespace":"config","package":"ts-jest","transformerId":1,"tsJestConfig":{"compiler":"typescript","diagnostics":{"ignoreCodes":[6059,18002,18003],"pretty":true,"throws":true},"isolatedModules":false,"packageJson":{"kind":"file"},"transformers":[],"tsConfig":{"kind":"file"}},"version":"24.0.2"},"message":"normalized ts-jest config","sequence":9,"time":"2019-08-14T20:04:06.341Z"}
{"context":{"logLevel":20,"namespace":"config","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"babel is disabled","sequence":10,"time":"2019-08-14T20:04:06.355Z"}
{"context":{"logLevel":20,"namespace":"Importer","package":"ts-jest","requireResult":{"exists":true,"given":"typescript","path":"/users/teddy/project/node_modules/typescript/lib/typescript.js"},"version":"24.0.2"},"message":"loaded module typescript","sequence":11,"time":"2019-08-14T20:04:06.573Z"}
{"context":{"logLevel":20,"namespace":"Importer","package":"ts-jest","version":"24.0.2"},"message":"patching typescript","sequence":12,"time":"2019-08-14T20:04:06.573Z"}
{"context":{"actualVersion":"3.5.3","expectedVersion":">=2.7 <4","logLevel":20,"namespace":"versions","package":"ts-jest","version":"24.0.2"},"message":"checking version of typescript: OK","sequence":13,"time":"2019-08-14T20:04:06.574Z"}
{"context":{"logLevel":20,"namespace":"config","package":"ts-jest","transformerId":1,"tsConfigFileName":"/users/teddy/project/tsconfig.json","version":"24.0.2"},"message":"readTsConfig(): reading /users/teddy/project/tsconfig.json","sequence":14,"time":"2019-08-14T20:04:06.574Z"}
{"context":{"logLevel":20,"namespace":"config","package":"ts-jest","transformerId":1,"tsconfig":{"input":{"compilerOptions":{"baseUrl":"lib","declaration":true,"esModuleInterop":true,"module":"ESNext","moduleResolution":"node","outDir":"dist","strict":true,"target":"ESNext"}},"resolved":{"compileOnSave":false,"configFileSpecs":{"excludeSpecs":["dist"],"includeSpecs":["**/*"],"validatedExcludeSpecs":["dist"],"validatedIncludeSpecs":["**/*"],"wildcardDirectories":{"/users/teddy/project":1}},"errors":[],"fileNames":["/users/teddy/project/lib/language/country.ts","/users/teddy/project/lib/language/index.ts","/users/teddy/project/lib/language/language.ts","/users/teddy/project/lib/language/locale.ts","/users/teddy/project/lib/language/states.ts","/users/teddy/project/lib/language/__tests__/index.test.ts","/users/teddy/project/lib/language/dist/country.d.ts","/users/teddy/project/lib/language/dist/index.d.ts","/users/teddy/project/lib/language/dist/language.d.ts","/users/teddy/project/lib/language/dist/locale.d.ts","/users/teddy/project/lib/language/dist/states.d.ts"],"options":{"baseUrl":"/users/teddy/project/lib","configFilePath":"/users/teddy/project/tsconfig.json","declaration":false,"esModuleInterop":true,"inlineSourceMap":false,"inlineSources":true,"module":1,"moduleResolution":2,"noEmit":false,"outDir":"$$ts-jest$$","removeComments":false,"sourceMap":true,"strict":true,"target":8},"raw":{"compileOnSave":false,"compilerOptions":{"baseUrl":"lib","declaration":true,"esModuleInterop":true,"module":"ESNext","moduleResolution":"node","outDir":"dist","strict":true,"target":"ESNext"}},"typeAcquisition":{"enable":false,"exclude":[],"include":[]},"wildcardDirectories":{"/users/teddy/project":1}}},"version":"24.0.2"},"message":"normalized typescript config","sequence":15,"time":"2019-08-14T20:04:06.588Z"}
{"context":{"fileName":"/users/teddy/project/lib/language/index.ts","logLevel":20,"namespace":"jest-transformer","package":"ts-jest","transformOptions":{"config":{"automock":false,"browser":false,"cache":true,"cacheDirectory":"/private/var/folders/25/8lt2lnwj66qc3f54hwylfy5m0000gn/T/jest_dx","clearMocks":false,"coveragePathIgnorePatterns":["/node_modules/"],"cwd":"/users/teddy/project","dependencyExtractor":null,"detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"filter":null,"forceCoverageMatch":[],"globalSetup":null,"globalTeardown":null,"globals":{},"haste":{"computeSha1":false,"providesModuleNodeModules":[],"throwOnModuleCollision":false},"moduleDirectories":["node_modules"],"moduleFileExtensions":["js","json","jsx","ts","tsx","node"],"moduleNameMapper":{},"modulePathIgnorePatterns":[".yarn_cache"],"name":"daa62f0157dd9296f5160a0bf13f5a4c","prettierPath":"prettier","resetMocks":false,"resetModules":false,"resolver":null,"restoreMocks":false,"rootDir":"/users/teddy/project","roots":["/users/teddy/project"],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"snapshotSerializers":[],"testEnvironment":"/users/teddy/project/node_modules/jest-environment-node/build/index.js","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":["**/__tests__/**/*.[jt]s?(x)","**/?(*.)+(spec|test).[tj]s?(x)"],"testPathIgnorePatterns":["/dist/"],"testRegex":[],"testRunner":"/users/teddy/project/node_modules/jest-jasmine2/build/index.js","testURL":"http://localhost","timers":"fake","transform":[["^.+\\.ts?$","/users/teddy/project/node_modules/ts-jest/dist/index.js"]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"instrument":false,"rootDir":"/users/teddy/project"},"transformerId":1,"version":"24.0.2"},"message":"computing cache key for /users/teddy/project/lib/language/index.ts","sequence":16,"time":"2019-08-14T20:04:06.591Z"}
{"context":{"fileName":"/users/teddy/project/lib/language/country.ts","logLevel":20,"namespace":"jest-transformer","package":"ts-jest","transformOptions":{"config":{"automock":false,"browser":false,"cache":true,"cacheDirectory":"/private/var/folders/25/8lt2lnwj66qc3f54hwylfy5m0000gn/T/jest_dx","clearMocks":false,"coveragePathIgnorePatterns":["/node_modules/"],"cwd":"/users/teddy/project","dependencyExtractor":null,"detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"filter":null,"forceCoverageMatch":[],"globalSetup":null,"globalTeardown":null,"globals":{},"haste":{"computeSha1":false,"providesModuleNodeModules":[],"throwOnModuleCollision":false},"moduleDirectories":["node_modules"],"moduleFileExtensions":["js","json","jsx","ts","tsx","node"],"moduleNameMapper":{},"modulePathIgnorePatterns":[".yarn_cache"],"name":"daa62f0157dd9296f5160a0bf13f5a4c","prettierPath":"prettier","resetMocks":false,"resetModules":false,"resolver":null,"restoreMocks":false,"rootDir":"/users/teddy/project","roots":["/users/teddy/project"],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"snapshotSerializers":[],"testEnvironment":"/users/teddy/project/node_modules/jest-environment-node/build/index.js","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":["**/__tests__/**/*.[jt]s?(x)","**/?(*.)+(spec|test).[tj]s?(x)"],"testPathIgnorePatterns":["/dist/"],"testRegex":[],"testRunner":"/users/teddy/project/node_modules/jest-jasmine2/build/index.js","testURL":"http://localhost","timers":"fake","transform":[["^.+\\.ts?$","/users/teddy/project/node_modules/ts-jest/dist/index.js"]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"instrument":false,"rootDir":"/users/teddy/project"},"transformerId":1,"version":"24.0.2"},"message":"computing cache key for /users/teddy/project/lib/language/country.ts","sequence":17,"time":"2019-08-14T20:04:06.592Z"}
{"context":{"fileName":"/users/teddy/project/lib/language/country.ts","logLevel":20,"namespace":"jest-transformer","package":"ts-jest","transformOptions":{"instrument":false},"transformerId":1,"version":"24.0.2"},"message":"processing /users/teddy/project/lib/language/country.ts","sequence":18,"time":"2019-08-14T20:04:06.592Z"}
{"context":{"logLevel":20,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"creating typescript compiler (language service)","sequence":19,"time":"2019-08-14T20:04:06.593Z"}
{"context":{"cacheDirectory":"/private/var/folders/25/8lt2lnwj66qc3f54hwylfy5m0000gn/T/jest_dx/ts-jest/cd/34e08961f6910c2d0495e3025f78fcd8b67555","logLevel":20,"namespace":"config","package":"ts-jest","version":"24.0.2"},"message":"will use file caching","sequence":20,"time":"2019-08-14T20:04:06.593Z"}
{"context":{"logLevel":20,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"creating language service","sequence":21,"time":"2019-08-14T20:04:06.593Z"}
{"context":{"fileName":"/users/teddy/project/lib/language/country.ts","logLevel":20,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readThrough(): cache miss","sequence":22,"time":"2019-08-14T20:04:06.594Z"}
{"context":{"fileName":"/users/teddy/project/lib/language/country.ts","logLevel":20,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getOutput(): compiling using language service","sequence":23,"time":"2019-08-14T20:04:06.594Z"}
{"context":{"fileName":"/users/teddy/project/lib/language/country.ts","logLevel":20,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"updateMemoryCache()","sequence":24,"time":"2019-08-14T20:04:06.594Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/country.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":25,"time":"2019-08-14T20:04:06.595Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/lib/language/index.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":26,"time":"2019-08-14T20:04:06.595Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/lib/language/language.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":27,"time":"2019-08-14T20:04:06.595Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/lib/language/locale.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":28,"time":"2019-08-14T20:04:06.596Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/lib/language/states.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":29,"time":"2019-08-14T20:04:06.596Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/lib/language/__tests__/index.test.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":30,"time":"2019-08-14T20:04:06.596Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/lib/language/dist/country.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":31,"time":"2019-08-14T20:04:06.597Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/lib/language/dist/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":32,"time":"2019-08-14T20:04:06.597Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/lib/language/dist/language.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":33,"time":"2019-08-14T20:04:06.597Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/lib/language/dist/locale.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":34,"time":"2019-08-14T20:04:06.598Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/lib/language/dist/states.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":35,"time":"2019-08-14T20:04:06.598Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":36,"time":"2019-08-14T20:04:06.621Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":37,"time":"2019-08-14T20:04:06.623Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":38,"time":"2019-08-14T20:04:06.623Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":39,"time":"2019-08-14T20:04:06.624Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":40,"time":"2019-08-14T20:04:06.627Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":41,"time":"2019-08-14T20:04:06.628Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":42,"time":"2019-08-14T20:04:06.629Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":43,"time":"2019-08-14T20:04:06.629Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":44,"time":"2019-08-14T20:04:06.631Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":45,"time":"2019-08-14T20:04:06.632Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":46,"time":"2019-08-14T20:04:06.634Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":47,"time":"2019-08-14T20:04:06.636Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":48,"time":"2019-08-14T20:04:06.637Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":49,"time":"2019-08-14T20:04:06.638Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":50,"time":"2019-08-14T20:04:06.639Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":51,"time":"2019-08-14T20:04:06.641Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":52,"time":"2019-08-14T20:04:06.642Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":53,"time":"2019-08-14T20:04:06.643Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":54,"time":"2019-08-14T20:04:06.644Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":55,"time":"2019-08-14T20:04:06.644Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":56,"time":"2019-08-14T20:04:06.646Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":57,"time":"2019-08-14T20:04:06.646Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":58,"time":"2019-08-14T20:04:06.650Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":59,"time":"2019-08-14T20:04:06.651Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/babel__core/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":60,"time":"2019-08-14T20:04:06.651Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":61,"time":"2019-08-14T20:04:06.668Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":62,"time":"2019-08-14T20:04:06.670Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":63,"time":"2019-08-14T20:04:06.671Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":64,"time":"2019-08-14T20:04:06.672Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":65,"time":"2019-08-14T20:04:06.673Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":66,"time":"2019-08-14T20:04:06.675Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":67,"time":"2019-08-14T20:04:06.676Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":68,"time":"2019-08-14T20:04:06.677Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/babel__generator/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":69,"time":"2019-08-14T20:04:06.677Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@babel/types/lib/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":70,"time":"2019-08-14T20:04:06.680Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/babel__traverse/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":71,"time":"2019-08-14T20:04:06.714Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/babel__template/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":72,"time":"2019-08-14T20:04:06.740Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":73,"time":"2019-08-14T20:04:06.741Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/babel__template/node_modules/@babel/parser/typings/babel-parser.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":74,"time":"2019-08-14T20:04:06.742Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/babel__core/node_modules/@babel/parser/typings/babel-parser.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":75,"time":"2019-08-14T20:04:06.745Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/istanbul-lib-coverage/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":76,"time":"2019-08-14T20:04:06.746Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/istanbul-lib-report/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":77,"time":"2019-08-14T20:04:06.747Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":78,"time":"2019-08-14T20:04:06.748Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":79,"time":"2019-08-14T20:04:06.750Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/istanbul-reports/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":80,"time":"2019-08-14T20:04:06.751Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":81,"time":"2019-08-14T20:04:06.752Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":82,"time":"2019-08-14T20:04:06.753Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/jest/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":83,"time":"2019-08-14T20:04:06.754Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":84,"time":"2019-08-14T20:04:06.766Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/jest-diff/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":85,"time":"2019-08-14T20:04:06.766Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":86,"time":"2019-08-14T20:04:06.768Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/jest-diff/build/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":87,"time":"2019-08-14T20:04:06.768Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":88,"time":"2019-08-14T20:04:06.770Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/jest-diff/build/types.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":89,"time":"2019-08-14T20:04:06.770Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/ts3.2/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":90,"time":"2019-08-14T20:04:06.770Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/base.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":91,"time":"2019-08-14T20:04:06.771Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/globals.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":92,"time":"2019-08-14T20:04:06.772Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/assert.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":93,"time":"2019-08-14T20:04:06.784Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/async_hooks.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":94,"time":"2019-08-14T20:04:06.785Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/buffer.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":95,"time":"2019-08-14T20:04:06.788Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/child_process.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":96,"time":"2019-08-14T20:04:06.788Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":97,"time":"2019-08-14T20:04:06.795Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":98,"time":"2019-08-14T20:04:06.796Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/cluster.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":99,"time":"2019-08-14T20:04:06.799Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/console.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":100,"time":"2019-08-14T20:04:06.804Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/constants.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":101,"time":"2019-08-14T20:04:06.805Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/crypto.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":102,"time":"2019-08-14T20:04:06.808Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/dgram.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":103,"time":"2019-08-14T20:04:06.812Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/dns.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":104,"time":"2019-08-14T20:04:06.815Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/domain.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":105,"time":"2019-08-14T20:04:06.818Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/events.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":106,"time":"2019-08-14T20:04:06.819Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/fs.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":107,"time":"2019-08-14T20:04:06.820Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":108,"time":"2019-08-14T20:04:06.842Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":109,"time":"2019-08-14T20:04:06.844Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/http.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":110,"time":"2019-08-14T20:04:06.844Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/http2.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":111,"time":"2019-08-14T20:04:06.847Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/https.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":112,"time":"2019-08-14T20:04:06.858Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/inspector.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":113,"time":"2019-08-14T20:04:06.859Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/module.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":114,"time":"2019-08-14T20:04:06.875Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/net.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":115,"time":"2019-08-14T20:04:06.875Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/os.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":116,"time":"2019-08-14T20:04:06.877Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/path.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":117,"time":"2019-08-14T20:04:06.878Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/perf_hooks.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":118,"time":"2019-08-14T20:04:06.879Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/process.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":119,"time":"2019-08-14T20:04:06.882Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/punycode.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":120,"time":"2019-08-14T20:04:06.883Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/querystring.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":121,"time":"2019-08-14T20:04:06.883Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/readline.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":122,"time":"2019-08-14T20:04:06.884Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/repl.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":123,"time":"2019-08-14T20:04:06.886Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/stream.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":124,"time":"2019-08-14T20:04:06.892Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/string_decoder.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":125,"time":"2019-08-14T20:04:06.894Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/timers.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":126,"time":"2019-08-14T20:04:06.895Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/tls.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":127,"time":"2019-08-14T20:04:06.895Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/trace_events.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":128,"time":"2019-08-14T20:04:06.899Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/tty.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":129,"time":"2019-08-14T20:04:06.900Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/url.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":130,"time":"2019-08-14T20:04:06.901Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":131,"time":"2019-08-14T20:04:06.903Z"}
{"context":{"call":null,"logLevel":10,"namespace":"ts:serviceHost","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"readFile","sequence":132,"time":"2019-08-14T20:04:06.905Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/util.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":133,"time":"2019-08-14T20:04:06.905Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/v8.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":134,"time":"2019-08-14T20:04:06.909Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/vm.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":135,"time":"2019-08-14T20:04:06.909Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/worker_threads.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":136,"time":"2019-08-14T20:04:06.910Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/zlib.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":137,"time":"2019-08-14T20:04:06.912Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/ts3.2/util.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":138,"time":"2019-08-14T20:04:06.914Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/node/ts3.2/globals.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":139,"time":"2019-08-14T20:04:06.914Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2018.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":140,"time":"2019-08-14T20:04:06.915Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2017.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":141,"time":"2019-08-14T20:04:06.916Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2016.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":142,"time":"2019-08-14T20:04:06.917Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2015.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":143,"time":"2019-08-14T20:04:06.917Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es5.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":144,"time":"2019-08-14T20:04:06.918Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2015.core.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":145,"time":"2019-08-14T20:04:06.947Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2015.collection.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":146,"time":"2019-08-14T20:04:06.950Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2015.generator.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":147,"time":"2019-08-14T20:04:06.951Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2015.promise.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":148,"time":"2019-08-14T20:04:06.951Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2015.iterable.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":149,"time":"2019-08-14T20:04:06.952Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2015.symbol.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":150,"time":"2019-08-14T20:04:06.955Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2015.proxy.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":151,"time":"2019-08-14T20:04:06.955Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2015.reflect.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":152,"time":"2019-08-14T20:04:06.956Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":153,"time":"2019-08-14T20:04:06.956Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2016.array.include.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":154,"time":"2019-08-14T20:04:06.959Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2017.object.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":155,"time":"2019-08-14T20:04:06.960Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":156,"time":"2019-08-14T20:04:06.961Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2017.string.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":157,"time":"2019-08-14T20:04:06.962Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2017.intl.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":158,"time":"2019-08-14T20:04:06.962Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":159,"time":"2019-08-14T20:04:06.963Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":160,"time":"2019-08-14T20:04:06.963Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2018.promise.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":161,"time":"2019-08-14T20:04:06.963Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2018.regexp.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":162,"time":"2019-08-14T20:04:06.965Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2018.intl.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":163,"time":"2019-08-14T20:04:06.965Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.esnext.intl.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":164,"time":"2019-08-14T20:04:06.965Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.esnext.bigint.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":165,"time":"2019-08-14T20:04:06.966Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/stack-utils/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":166,"time":"2019-08-14T20:04:06.970Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/@types/yargs/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":167,"time":"2019-08-14T20:04:06.971Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.esnext.full.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":168,"time":"2019-08-14T20:04:06.975Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.esnext.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":169,"time":"2019-08-14T20:04:06.975Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2019.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":170,"time":"2019-08-14T20:04:06.976Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2019.array.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":171,"time":"2019-08-14T20:04:06.976Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2019.object.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":172,"time":"2019-08-14T20:04:06.977Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2019.string.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":173,"time":"2019-08-14T20:04:06.978Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.es2019.symbol.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":174,"time":"2019-08-14T20:04:06.978Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.dom.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":175,"time":"2019-08-14T20:04:06.979Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":176,"time":"2019-08-14T20:04:07.064Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.scripthost.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":177,"time":"2019-08-14T20:04:07.067Z"}
{"context":{"cacheHit":false,"fileName":"/users/teddy/project/node_modules/typescript/lib/lib.dom.iterable.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache miss","sequence":178,"time":"2019-08-14T20:04:07.068Z"}
{"context":{"call":null,"logLevel":20,"namespace":"ts-hoisting","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"visitSourceFileNode(): hoisting","sequence":179,"time":"2019-08-14T20:04:07.378Z"}
{"context":{"fileName":"/users/teddy/project/lib/language/country.ts","logLevel":20,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getOutput(): computing diagnostics","sequence":180,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/country.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":181,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/index.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":182,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/language.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":183,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/locale.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":184,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/states.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":185,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/__tests__/index.test.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":186,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/country.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":187,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":188,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/language.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":189,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/locale.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":190,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/states.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":191,"time":"2019-08-14T20:04:07.408Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/country.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":192,"time":"2019-08-14T20:04:07.409Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/index.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":193,"time":"2019-08-14T20:04:07.409Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/language.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":194,"time":"2019-08-14T20:04:07.409Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/locale.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":195,"time":"2019-08-14T20:04:07.409Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/states.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":196,"time":"2019-08-14T20:04:07.409Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/__tests__/index.test.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":197,"time":"2019-08-14T20:04:07.409Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/country.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":198,"time":"2019-08-14T20:04:07.410Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":199,"time":"2019-08-14T20:04:07.410Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/language.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":200,"time":"2019-08-14T20:04:07.410Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/locale.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":201,"time":"2019-08-14T20:04:07.410Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/states.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":202,"time":"2019-08-14T20:04:07.410Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/country.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":203,"time":"2019-08-14T20:04:07.410Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/index.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":204,"time":"2019-08-14T20:04:07.410Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/language.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":205,"time":"2019-08-14T20:04:07.410Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/locale.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":206,"time":"2019-08-14T20:04:07.411Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/states.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":207,"time":"2019-08-14T20:04:07.411Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/__tests__/index.test.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":208,"time":"2019-08-14T20:04:07.411Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/country.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":209,"time":"2019-08-14T20:04:07.411Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/index.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":210,"time":"2019-08-14T20:04:07.412Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/language.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":211,"time":"2019-08-14T20:04:07.413Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/locale.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":212,"time":"2019-08-14T20:04:07.413Z"}
{"context":{"cacheHit":true,"fileName":"/users/teddy/project/lib/language/dist/states.d.ts","logLevel":10,"namespace":"ts-compiler","package":"ts-jest","transformerId":1,"version":"24.0.2"},"message":"getScriptSnapshot(): cache hit","sequence":213,"time":"2019-08-14T20:04:07.413Z"}
{"context":{"diagnosticCodes":[1343],"diagnosticText":"\u001b[96mlib/language/country.ts\u001b[0m:\u001b[93m8\u001b[0m:\u001b[93m39\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS1343: \u001b[0mThe 'import.meta' meta-property is only allowed using 'ESNext' for the 'target' and 'module' compiler options.\n\n\u001b[7m8\u001b[0m const dirname2 = path.dirname(new URL(import.meta.url).pathname);\n\u001b[7m \u001b[0m \u001b[91m                                      ~~~~~~~~~~~\u001b[0m\n","logLevel":20,"namespace":"TSError","package":"ts-jest","version":"24.0.2"},"message":"created new TSError","sequence":214,"time":"2019-08-14T20:04:07.419Z"}

Minimal repo :

https://github.com/ejmartin504/test-ts

@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 24, 2019

Hi, I see your jest.config.js doesn't have preset: 'ts-jest'. Would you please try adding that in your jest.config.js ? More about installation and configuration can be found at online documentation

@hedefalk
Copy link

I'm having the same issue as @ejmartin504.

TSError: TypeScript diagnostics (customize using `[jest-config].globals.ts-jest.diagnostics` option):
    src/schema.ts:5:40 - error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'esnext' or 'system'.

    5 const __dirname = path.dirname(new URL(import.meta.url).pathname)
                                             ~~~~~~~~~~~

    > 1 | test('schema should parse', async () => {
        | ^
      2 |   const schema = await import('../src/schema')
      3 |
      4 |   expect(schema)

      at new Spec (../../node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
      at Object.<anonymous> (spec/schema-validation.spec.ts:1:1)

Using preset ts-jest doesn't help. Docs says

By default, it’ll use the default TypeScript and use the project’s tsconfig.json file. If it cannot find one, it’ll use defaults TypeScript compiler options (except es5 is used as target instead of es3).

but I have


 "compilerOptions": {
    "module": "esnext",

set in my tsconfig.json. It just seems that ts-jest doesn't honour my ts settings.

@ejmartin504 Did you find a way around this?

@hedefalk
Copy link

Stuff happens around here, I might need to debug this to understand what's going on: https://github.com/kulshekhar/ts-jest/blob/master/src/config/config-set.ts#L712

@hedefalk
Copy link

hedefalk commented Nov 1, 2019

This is the problem I think:

// force the module kind if not piping babel-jest
if (!this.tsJest.babelConfig) {
// commonjs is required for jest
options.module = this.compilerModule.ModuleKind.CommonJS
}

I'm guessing here, but since I want to use node with --experimental-modules and not use babel, this messes up for me. My ts-config to output esm is overwritten because I haven't attached any babel transpilation?

@ahnpnl
Copy link
Collaborator

ahnpnl commented Nov 9, 2019

Hi,

I think I found something related to this in here.

Would you guys that solution ? I think indeed you need to ask babel-jest to transform into commonjs.

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jan 8, 2020

My ts-config to output esm is overwritten because I haven't attached any babel transpilation?

Yes, because when there is no babel and jest expects commonjs therefore your esm output config isn't respected. I think you do need babel-jest to solve this issue.

@ahnpnl
Copy link
Collaborator

ahnpnl commented Feb 3, 2020

close as not ts-jest issue, module has to go with commonjs

@ahnpnl ahnpnl closed this as completed Feb 3, 2020
@ahnpnl
Copy link
Collaborator

ahnpnl commented May 27, 2020

import.meta is only valid for esm. Jest is working on supporting it jestjs/jest#9430 . I think now ts-jest can unforce commonjs module in internal code

@hedefalk
Copy link

hedefalk commented Jun 3, 2020

I'm still struggling with this. I had forgotten about this issue and started to create a repro case for jestjs/jest#9430. But I couldn't get to the same issue as my production code in the repro until I found this issue again and realized I needed babel to get pass that.

My setup is just:

  • ts, jest, ts-jest and node 13 with esm.

And I'm trying to use

const __dirname = path.dirname(new URL(import.meta.url).pathname)

Here's a pretty small repro:

https://github.com/hedefalk/jest-esm-ts-issue

Any help on workaround is highly appreciated. As I understand it, its basically not possible to use ts-jest with esm. I'm having to run a separate tsc and test on the output for now.

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jun 3, 2020

at the moment, ts-jest is still set default module to commonjs. We can enable esm by removing this condition.

Unfortunately there is no workaround now :) I still don't know what is the suitable time to remove that hardcoded condition, maybe once jestjs/jest#9430 is completed. For now, imo ts-jest can offer a new option in config, something like experimentalEsm. When this option is enabled, the hardcoded target can be ignored and will use target from tsconfig.

A PR is welcome for that new option :)

@hedefalk
Copy link

hedefalk commented Jun 3, 2020

@ahnpnl

I'm not sure I follow entirely. I tried just removing that override condition entirely in my node_modules/ts-jest/dist/config-set.js:

 console.log('not doing any module kind override')
            // if (!this.tsJest.babelConfig) {
            //     options.module = this.compilerModule.ModuleKind.CommonJS;
            // }

But still leaving the babel config around, I still get that issue:

✗ node --experimental-vm-modules node_modules/.bin/jest
 FAIL  spec/foo.spec.ts
  ● Test suite failed to run

    /Users/viktor/dev/projects/jest-esm-ts-issue/src/foo.ts:12
    const _dirname = _path.default.dirname(new URL(import.meta.url).pathname);
                                                          ^^^^

    SyntaxError: Cannot use 'import.meta' outside a module

    > 1 | import { bar } from "../src/foo"
        | ^
      2 |
      3 | describe("foo", () => {
      4 |   it("should work", () => {

      at Runtime._execModule (node_modules/jest-runtime/build/index.js:1166:56)
      at Object.<anonymous> (spec/foo.spec.ts:1:1)

not doing any module kind override
Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        2.607 s
Ran all test suites.

Maybe my babel config is all messed up, dunno, but I can't seem to do without it…

@hedefalk
Copy link

hedefalk commented Jun 3, 2020

Oh, sorry, its not the same issue of course, a later one…

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jun 3, 2020

by removing that condition, it only allows ts-jest to compile codes to target esm. However, the error stack comes after that is because jest doesn't work with it.

There are some discussions about how transformers pass compiled out to jest. At the moment, ts-jest always passes with js extension. Idk how jest detects whether or not a compiled output is esm or cjs (See the note Detect if a file is supposed to be ESM or CJS mode in jestjs/jest#9430)

Discussion about extension is here jestjs/jest#9860 . Also related to the error you got

@hedefalk
Copy link

hedefalk commented Jun 3, 2020

@ahnpnl Yeah, thanks, realized after posting.

I think I should report over there. It's supposed to look at the package.json and if type=module it should be a ESM, right?

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jun 3, 2020

I just put a question here jestjs/jest#9860 (comment)

In general, my opinions are:

  • If the code outside node_modules, it doesn't require to check type=module but relies only on target from tsconfig. After transforming this code, the file extension probably should be mjs before giving that transpiled file to jest

  • If the code inside node_modules, I'm not quite sure, either just do like the above way or just simply transform using target from tsconfig but not changing file extension to mjs ?

The main concern is what kind of file extensions that ts-jest should give to jest. If there are different file extensions depdending on type of target, then which file extension for which target

@hedefalk
Copy link

hedefalk commented Jun 3, 2020

@ahnpnl Thx for the explanation!

Mostly note to self, just double checked. I could finally run my tests by monkey patching to always return true here:

https://github.com/facebook/jest/blob/6a0f070e0210eb11408a7c8ebb003ff73d62e420/packages/jest-resolve/src/shouldLoadAsEsm.ts#L36

But then I had @babel/plugin-syntax-import-meta in my babel for some reason which transpiled it into require so it broke anyways:

❯ node --experimental-vm-modules node_modules/.bin/jest
 FAIL  spec/foo.spec.ts
  ● Test suite failed to run

    ReferenceError: require is not defined

    > 1 | import { bar } from "../src/foo"
        | ^
      2 |
      3 | describe("foo", () => {
      4 |   it("should work", () => {

      at spec/foo.spec.ts:1:1

So had to remove that one, but after that I could finally run it:

✗ node --experimental-vm-modules node_modules/.bin/jest
(node:43695) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
 PASS  spec/foo.spec.ts
  foo
    ✓ should work (2 ms)

always esm
not doing any module kind override
always esm
Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.649 s
Ran all test suites.

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jun 3, 2020

Nice 👍 that means it is possible but just need some clarifications from jest to implement the correct way for ts-jest.

Or ts-jest can use the simplest approach by giving compiled file with mjs/cjs depending on target under a new config option “experimentalEsm”. This will give ts-jest users opportunities to test esm. Once getting the final recommendation from jest, the implementation can change.

@ahnpnl ahnpnl mentioned this issue Jun 4, 2020
@hedefalk
Copy link

hedefalk commented Jun 4, 2020

A PR is welcome for that new option :)

Trying to be a good citizen and also I'd hate to maintain a monkey patching sed/awk :)

Started here: master...hedefalk:master

I was hoping to be able to just do the option in ts-jest and that outputting a .mjs extension would be enough. However, the logic here is looking at the actual input files:

https://github.com/facebook/jest/blob/6a0f070e0210eb11408a7c8ebb003ff73d62e420/packages/jest-resolve/src/shouldLoadAsEsm.ts#L36

which in our case is .ts so nothing I can to in ts-jest will help without that being fixed in jest.

@FrameMuse
Copy link

If I understood it right, you just need to add the following to package.json:

...,
scripts: {
  "test": "node --experimental-vm-modules node_modules/.bin/jest",
  ...
}

And then run it like this:
npm t

@DenisValcke
Copy link

Is there a working solution for this problem? I'm unable to write tests for my codebase because of this and can't seem to find a working fix. Also using vite like mentioned in the linked issue above here.

@ahnpnl
Copy link
Collaborator

ahnpnl commented Sep 23, 2021

The only way to use import.meta is you need to run Jest in ESM mode, see https://kulshekhar.github.io/ts-jest/docs/guides/esm-support

@DenisValcke
Copy link

@ahnpnl thanks for the info. This uses Jest v27 though and I'm on v26. I did find a workaround albeit a bit verbose and not ideal but my tests are running now. I just provided the dependency that contains import.meta in another way so I can mock that dependency in my tests and avoid Jest tripping over it.

@shumih
Copy link

shumih commented Oct 9, 2021

You can always isolate es6 only code without changing jest configurations, presets, transformers and experimental features usage.

Isolate file with import.meta.url:

export const worker = import('pdfjs-dist/build/pdf').then(pdfjs => {
  pdfjs.GlobalWorkerOptions.workerPort = new Worker(new URL('pdfjs-dist/build/pdf.worker', import.meta.url), {
    type: 'module',
  });

  return pdfjs;
})

and mock this import in the setup file via jest.mock (setupFilesAfterEnv):

jest.mock('../libs/shared/pdf/src/lib/pdf-processing.worker', () => ({ worker: Promise.resolve() }));

@kraftwerk28
Copy link

kraftwerk28 commented Nov 4, 2021

I'm getting
The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
error, though I'm using esm.

jest.config.cjs

const ts = require("typescript");
const { pathsToModuleNameMapper } = require("ts-jest/utils");

const { config: tsconfig } = ts.readConfigFile(
  "./tsconfig.json",
  ts.sys.readFile,
);

/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
const config = {
  testEnvironment: "jsdom",
  transform: {
    "^.+\\.tsx?$": ["ts-jest"],
  },
  moduleNameMapper: pathsToModuleNameMapper(
    tsconfig.compilerOptions.paths ?? {},
    { prefix: "<rootDir>" },
  ),
  extensionsToTreatAsEsm: [".ts", ".tsx"],
  globals: {
    "ts-jest": {
      useESM: true,
    },
  },
};

module.exports = config;

tsconfig.json:

{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    // ...
  },
}

Is there any solution so far? Thanks in advance!

@rondonjon
Copy link

@kraftwerk28:

Have you read and followed all steps in the ESM instructions? I had a similar problem, and it turned out that I had missed part of the setup because I had mistaken the first link as "documentation only" and skipped it, but the page actually contains some important steps.

TL;DR:

@fayeah
Copy link

fayeah commented Mar 4, 2022

You can always isolate es6 only code without changing jest configurations, presets, transformers and experimental features usage.

Isolate file with import.meta.url:

export const worker = import('pdfjs-dist/build/pdf').then(pdfjs => {
  pdfjs.GlobalWorkerOptions.workerPort = new Worker(new URL('pdfjs-dist/build/pdf.worker', import.meta.url), {
    type: 'module',
  });

  return pdfjs;
})

and mock this import in the setup file via jest.mock (setupFilesAfterEnv):

jest.mock('../libs/shared/pdf/src/lib/pdf-processing.worker', () => ({ worker: Promise.resolve() }));

hi could you please help to check what is not correct in my configuration? I also use this mock method, but it seems not work...

// jest.config.js
module.exports = {
  setupFilesAfterEnv: ['<rootDir>/src/__tests__/setup.ts'],
  ...
}

// setup.ts
console.log(`============ testSetupFile Loaded ===========`);
jest.mock("../utils/sentry", () => ({ setupSentry: Promise.resolve() }));

// sentry.ts file
export const setupSentry = (app: Vue) => {
  if (import.meta.env.PROD) {
    Sentry.init({
...
}

the log is printed as expected, but the execution will still go to the function setupSentry, will appreciate it very much for your kind help.

@kulkarnipradnyas
Copy link

@kraftwerk28:

Have you read and followed all steps in the ESM instructions? I had a similar problem, and it turned out that I had missed part of the setup because I had mistaken the first link as "documentation only" and skipped it, but the page actually contains some important steps.

TL;DR:

What exactly did you do to resolve it?

  1. i have added extensionsToTreatAsEsm: [".ts"] in jest
    2."test": " node --experimental-vm-modules && jest --config=jest.config.js --env=jest-environment-jsdom-sixteen"
    3.in babel.rc =>
    const presets = [
    ["@babel/preset-env", { targets: { node: "current" } }],
    "@babel/preset-typescript",
    ];
    what else can be done?

@annalyncs
Copy link

I ran into the same issue with Jest and TypeScript not recognizing import.meta.env. With the error error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext' and this worked for me. I did not modify my "test" script to run experimental-vm-modules or modify my babel config to add any other presets, the only preset is @babel/preset-env.

  1. Install babel-plugin-transform-vite-meta-env as a dev dependency
  2. Added this to jest.config.js:
  extensionsToTreatAsEsm: ['.ts'],
  globals: {
    'ts-jest': {
      useESM: true,
      babelConfig: true,
      plugins: ['babel-plugin-transform-vite-meta-env']
    },
  transform: {
    '^[^.]+.vue$': '@vue/vue3-jest',
    '^.+\\.js$': 'babel-jest',
    '^.+\\.ts?$': 'ts-jest'
  }

After that was done I was able to have my tests pass successfully while using import.meta.env. I hope that helps!

@kulkarnipradnyas
Copy link

kulkarnipradnyas commented Aug 23, 2022

@annalyncs
It is giving below error now:
SyntaxError: Cannot use 'import.meta' outside a module

@MarconesOliveira
Copy link

Believe it or not, this worked:

Create a commonjs file, like "currentPath.cjs", Inside it put something like:

module.exports = __dirname;

In your module use:

import * as currentPath from "./currentPath.cjs";
console.log(currentPath.default);

@kulkarnipradnyas
Copy link

kulkarnipradnyas commented Aug 26, 2022

Below code will help to go away import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext':
Jest.config
globals: {
"ts-jest": {
tsconfig: false,
useESM: true,
babelConfig: true,
plugins: ["babel-plugin-transform-vite-meta-env"],
},
},
transform: {
"^.+\.(js|jsx|ts)$": "babel-jest",
},
tsconfig:
"compilerOptions": {
"module": "esnext",
...remaining configs
Now it will drag you to SyntaxError: Cannot use 'import.meta' outside a module this error:
babel.config.js
module.exports = function (api) {
api.cache(true);
const presets = [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
"@babel/preset-react",
];

return {
presets,
plugins: [
"@babel/plugin-transform-runtime",
"babel-plugin-transform-import-meta",
],
};
};
this will help you to go away above problem too.

@burmanp
Copy link

burmanp commented Sep 7, 2022

@kulkarnipradnyas Could you clarify where the code below goes?
Did you change anything to the jest.config.js file?
Thanks.

module.exports = function (api) {
api.cache(true);
const presets = [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
"@babel/preset-react",
];

return {
presets,
plugins: [
"@babel/plugin-transform-runtime",
"babel-plugin-transform-import-meta",
],
};
};

@kulkarnipradnyas
Copy link

Yes i have uodated in jest.config, tsconfig and babel.config.js file.I have highlighted file names in above solution.

@kulkarnipradnyas Could you clarify where the code below goes? Did you change anything to the jest.config.js file? Thanks.

module.exports = function (api) {
api.cache(true);
const presets = [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
"@babel/preset-react",
];

return {
presets,
plugins: [
"@babel/plugin-transform-runtime",
"babel-plugin-transform-import-meta",
],
};
};

@Yankovsky
Copy link

This package solves the problem https://github.com/ThomZz/ts-jest-mock-import-meta

@arananegra
Copy link

I don't get why this is closed. Currently having this issue. The only way to get around was to use @Yankovsky advice. All of the other ones didn't work.

@ivan-kleshnin
Copy link

ivan-kleshnin commented Dec 3, 2022

This package solves the problem https://github.com/ThomZz/ts-jest-mock-import-meta

By "solving a problem" you mean a need to manually mock files with import.meta with correct values and permanently keep them in sync with module hierarchy in code!? 😠 It's a hacky workaround at best, not a proper solution.

@Yankovsky
Copy link

@ivan-kleshnin it is an external dep of your module just like any other import. Seems natural to me to mock it in the test.
The AST transformation may seem a little hacky, but it works.

@trim21
Copy link

trim21 commented Dec 5, 2022

I end up using babel instead of ts-jest because of this…

@ahnpnl
Copy link
Collaborator

ahnpnl commented Dec 5, 2022

Import meta only works when running Jest in ESM mode. There are some example projects with base configuration to work with ESM, see https://github.com/kulshekhar/ts-jest/tree/main/examples Also, please take a look at documentation https://kulshekhar.github.io/ts-jest/docs/guides/esm-support

@replete
Copy link

replete commented Dec 31, 2022

For anyone else that finds this through a web search, my solution to this problem was to migrate to vitest which was surprisingly pain-free and overall looks a better solution regards ESM/typescript, Jest compatible too..

@armand1m
Copy link

any updates on the recommended approach to deal with this issue?

@FranRom
Copy link

FranRom commented Mar 15, 2023

I was tempted to use Vitest after some time looking for a solution for this issue, but it seems it's slower than jest in the actual version so I'm also searching for the best approach for solving it

@damdafayton
Copy link

damdafayton commented Apr 11, 2023

I don't get why this is closed. Currently having this issue. The only way to get around was to use @Yankovsky advice. All of the other ones didn't work.

this is the only solution worked for me. its year 2023. almost 3 years have passed and there seems to be no proper solution for this problem. why this issue is closed?

@ahnpnl
Copy link
Collaborator

ahnpnl commented Apr 11, 2023

Perhaps you can make a reproduce scenario with one of the exampe repos https://github.com/kulshekhar/ts-jest/tree/main/examples? Note that import.meta only works with ESM, so in the example repos, you need to run your test using test-esm script

@terwer
Copy link

terwer commented Apr 14, 2023

Still looking for a good approach, not a hack solution.
Currently babel is the only one not hack solution I can find

// babel.config.cjs
module.exports = {
  presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"],
  plugins: ["babel-plugin-transform-vite-meta-env"],
}
// jest.config.cjs
module.exports = {
  testEnvironment: "node",
}

test file

// index.spec.ts
describe("zhiEnv", () => {
  const NOT_EXIST_KEY = "NOT_EXIST_KEY"

  it("test env", () => {
    const env = new Env(import.meta.env)
    expect(env.getEnv(EnvConstants.NODE_ENV_KEY)).toEqual("test")
  })
})

package to install

pnpm add --save-dev babel-jest @babel/core @babel/preset-env
pnpm add --save-dev @babel/preset-typescript
pnpm add --save-dev babel-plugin-transform-vite-meta-env

result

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests