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

fix jest transpiling all node modules, make tests fast again #78

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

jonenst
Copy link
Contributor

@jonenst jonenst commented Jul 12, 2024

the previous regexp is bugged, it requires '//' in the filename !! As a result, all the files in node_modules don't pass the regex so nothing is ignored => everything is transformed

jest caches this in /tmp/jest_* so rerunning tests is fast, but the first time jest takes minutes to transform everything

@jonenst jonenst force-pushed the fixjesttransformallnodemodules branch 3 times, most recently from e66b4b6 to cc6abf3 Compare July 12, 2024 16:54
@sBouzols sBouzols self-requested a review July 15, 2024 06:36
the previous regexp is bugged, it requires '//' in the filename !!
As a result, all the files in node_modules don't pass the regex
so nothing is ignored => everything is transformed

jest caches this in /tmp/jest_* so rerunning tests is fast, but
the first time jest takes minutes to transform everything

also the previous config was incomplete for moduleNameMapper but this was not
visible because it transformed everything anyway:
    Jest encountered an unexpected token
    Details:
       /node_modules/ag-grid-community/styles/ag-grid.css:1
       ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){.ag-icon {
                                                                                         ^
       SyntaxError: Unexpected token '.'

    Details:
       /node_modules/react-dnd/dist/index.js:1
       ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export * from './core/index.js';
                                                                                         ^^^^^^
    SyntaxError: Unexpected token 'export'
@jonenst jonenst force-pushed the fixjesttransformallnodemodules branch from cc6abf3 to 5654f67 Compare July 15, 2024 08:11
@jonenst jonenst merged commit b95795d into main Jul 15, 2024
3 checks passed
@jonenst jonenst deleted the fixjesttransformallnodemodules branch July 15, 2024 08:13
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

Successfully merging this pull request may close these issues.

2 participants