question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jest occasionally tries to transform json files -- needs better transform regex

See original GitHub issue

Current Behavior

Once in while I get the following warnings when I run ‘tsdx test’ command:

ts-jest[jest-transformer] (WARN) Got a unknown file type to compile (file: /Users/smashercosmo/Documents/projects/tmp-babel-plugin/node_modules/@babel/core/package.json). To fix this, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match this kind of files anymore.
ts-jest[jest-transformer] (WARN) Got a unknown file type to compile (file: /Users/smashercosmo/Documents/projects/tmp-babel-plugin/node_modules/resolve/lib/core.json). To fix this, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match this kind of files anymore.
ts-jest[jest-transformer] (WARN) Got a unknown file type to compile (file: /Users/smashercosmo/Documents/projects/tmp-babel-plugin/node_modules/globals/globals.json). To fix this, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match this kind of files anymore.

Expected behavior

jest shouldn’t try transforming json files

Suggested solution(s)

Probably ‘json’ should be added to transformIgnorePatterns in jest config

Your environment

Software Version(s)
TSDX 0.7.2
TypeScript 3.5.2
npm 6.9.0
Operating System macOS Sierra 10.12.3

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
agilgur5commented, Mar 9, 2020

Fixed by #513 . It will be out in the next release

0reactions
SCasarottocommented, Feb 19, 2020

I am still seeing this issues in v0.12.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Jest
The configuration also can be stored in a JSON file as a plain object: ... transform [object<string, pathToTransformer | [pathToTransformer, ...
Read more >
on import JSON in NodeJS jest testing - Stack Overflow
Your transform regex contains .js which matches `.json. If you add an $ in the end, you'll select only files ending with .js...
Read more >
Configuring package.json · Jest
Jest attempts to scan your dependency tree once (up-front) and cache it in order to ease some of the filesystem raking that needs...
Read more >
Storyshots Addon | Storybook: Frontend workshop for UI ...
If using the Docs add-on with MDX stories you will need to configure Jest to transform MDX stories into something Storyshots can understand:....
Read more >
Ubuntu Manpage: jest.js - Delightful JavaScript Testing
[boolean] --cache Whether to use the transform cache. ... pattern relative to <rootDir> matching the files that coverage info needs to be collected...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found