Bumping @babel/preset-env from 7.12.1 to 7.12.7 breaks tests (jest)
See original GitHub issueBug Report
- I would like to work on a fix!
Current behavior
Bumping @babel/preset-env from 7.12.1 to 7.12.7 breaks tests
- Dependabot PR: https://github.com/wachunei/directUC/pull/162
- Tests run: https://github.com/wachunei/directUC/pull/162/checks?check_run_id=1448125840
Nullish coalescing and optional chaining operator are not parsed anymore.
Input Code
Example:
const getElement = container => container?.firstChild;
Expected behavior
To transform correctly
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
- Filename:
package.json#babel
"babel": {
"presets": [
"@babel/preset-env",
[
"@babel/preset-react",
{
"runtime": "automatic"
}
]
]
}
Environment
System:
OS: macOS 11.0.1
Binaries:
Node: 12.19.0 - ~/.nvm/versions/node/v12.19.0/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v12.19.0/bin/npm
npmPackages:
@babel/core: ^7.12.8 => 7.12.8
@babel/preset-env: ^7.12.7 => 7.12.7
@babel/preset-react: ^7.12.7 => 7.12.7
babel-jest: ^26.6.3 => 26.6.3
eslint: ^7.14.0 => 7.14.0
jest: ^26.6.3 => 26.6.3
Possible Solution
- Maybe enabling these features is required in the babel config but I would not expect that since it works before bumping patch version.
- Maybe babel-jest is ignoring babel config
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Getting Started - Jest
You just successfully wrote your first test using Jest! This test used expect and toBe to test that two values were exactly identical....
Read more >How to Use `import.meta` When Testing With Jest
I found the currently best solution is to use babel-plugin-transform-import-meta. That simple plugin replaces the import.meta.url syntax with Node.js code ...
Read more >php-parser - Projects - FOSSA
... dependabot/npm_and_yarn/babel/preset-env-7.12.1 ... test-call; test-continue-break; test-curly-offsetlookup; test-heredoc-and-nowdoc; test-magic-node ...
Read more >Mender server
fix CVEs rebuilding using the latest workflows:master; Update mender-artifact tool to latest. Dependency updates. Aggregated Dependabot Changelogs: Bumps github ...
Read more >jest encountered an unexpected token uuid - You.com | The AI ...
Out of the box Jest supports Babel, which will be used to transform your files ... the Angular Jest Preset docs seems to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure!
I did not use environment keys in my
package.json@browserslist
config because it was not being picked up correctly by parcel@v1. I resolved to upgrade to use node 14 for development. Thank you for the help.