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

chore: update Jest to 28 #1008

Merged
merged 4 commits into from
Jul 19, 2022
Merged

chore: update Jest to 28 #1008

merged 4 commits into from
Jul 19, 2022

Conversation

mdjastrzebski
Copy link
Member

Summary

Updates Jest (and related deps) to v28.
Resolves: #997

Test plan

All tests & checks should pass.

@thymikee
Copy link
Member

still needs some work, but the direction seems correct

@mdjastrzebski
Copy link
Member Author

All tests are failing with following error:

 FAIL  src/queries/__tests__/a11yAPI.test.tsx
  ● 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:

    SyntaxError: /Users/maciej/Development/OpenSource/react-native-testing-library/node_modules/@react-native/polyfills/error-guard.js: Missing semicolon. (14:4)

      12 | let _inGuard = 0;
      13 |
    > 14 | type ErrorHandler = (error: mixed, isFatal: boolean) => void;
         |     ^
      15 | type Fn<Args, Return> = (...Args) => Return;
      16 |
      17 | /**

      at instantiate (../node_modules/@babel/parser/lib/index.js:72:32)
      at constructor (../node_modules/@babel/parser/lib/index.js:358:12)
      at Parser.raise (../node_modules/@babel/parser/lib/index.js:3334:19)
      at Parser.semicolon (../node_modules/@babel/parser/lib/index.js:3995:10)
      at Parser.parseExpressionStatement (../node_modules/@babel/parser/lib/index.js:15125:10)
      at Parser.parseStatementContent (../node_modules/@babel/parser/lib/index.js:14676:19)
      at Parser.parseStatement (../node_modules/@babel/parser/lib/index.js:14528:17)
      at Parser.parseBlockOrModuleBlockBody (../node_modules/@babel/parser/lib/index.js:15167:25)
      at Parser.parseBlockBody (../node_modules/@babel/parser/lib/index.js:15158:10)
      at Parser.parseProgram (../node_modules/@babel/parser/lib/index.js:14446:10)

@mdjastrzebski mdjastrzebski marked this pull request as ready for review July 18, 2022 16:11
@mdjastrzebski mdjastrzebski merged commit 77bf93c into main Jul 19, 2022
@mdjastrzebski mdjastrzebski deleted the chore/deps-jest-28 branch July 19, 2022 07:53
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.

Verify support for Jest 28.
2 participants