> react-scripts test --transformIgnorePatterns 'node_modules/(?!(<your-package-goes-here>)/)'
FAIL src/__test__/estandar.test.js
● Test suite failed to run
Jest encountered an unexpected token
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
By default "node_modules" folder is ignored by transformers.
Here's what you can do:
• If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
• If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/configuration
For information about custom transformations, see:
https://jestjs.io/docs/code-transformation
Details:
/home/runner/work/portafolio/portafolio/node_modules/@adobe/css-tools/dist/index.cjs:121
}, options?.source || "");
^
SyntaxError: Unexpected token '.'
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
> 5 | import "@testing-library/jest-dom";
| ^
6 |
at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:172[8](https://github.com/rmaafs/portafolio/actions/runs/7771214636/job/21192265809?pr=60#step:6:9):14)
at Object.<anonymous> (node_modules/@testing-library/jest-dom/dist/utils.js:21:17)
at Object.<anonymous> (node_modules/@testing-library/jest-dom/dist/to-be-in-the-dom.js:7:14)
at Object.<anonymous> (node_modules/@testing-library/jest-dom/dist/matchers.js:168:21)
at Object.<anonymous> (node_modules/@testing-library/jest-dom/dist/extend-expect.js:3:42)
at Object.<anonymous> (node_modules/@testing-library/jest-dom/dist/index.js:3:1)
at Object.<anonymous> (src/setupTests.jsx:5:1)
at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
at runJest (node_modules/@jest/core/build/runJest.js:404:1[9](https://github.com/rmaafs/portafolio/actions/runs/7771214636/job/21192265809?pr=60#step:6:10))
at _run[10](https://github.com/rmaafs/portafolio/actions/runs/7771214636/job/21192265809?pr=60#step:6:11)000 (node_modules/@jest/core/build/cli/index.js:320:7)
at runCLI (node_modules/@jest/core/build/cli/index.js:173:3)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.9[16](https://github.com/rmaafs/portafolio/actions/runs/7771214636/job/21192265809?pr=60#step:6:17) s
Ran all test suites.
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.
babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
npm ERR! Test failed. See above for more details.