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

Jest v28 support? #409

Closed
karlhorky opened this issue May 3, 2022 · 2 comments · Fixed by #412
Closed

Jest v28 support? #409

karlhorky opened this issue May 3, 2022 · 2 comments · Fixed by #412

Comments

@karlhorky
Copy link
Contributor

Hi @ikatyang ! 👋 Hope that you are well.

Would you be willing to support Jest v28? It seems like there were some changes around process / processAsync, which cause dts-jest to fail:

FAIL dts src/__tests__/dts-jest/003-literals-unions.test.ts
  ● Test suite failed to run

    ● Invalid return value:
      `process()` or/and `processAsync()` method of code transformer found at 
      "/home/runner/work/courses/courses/slide-decks/slideDecks/typescript-fundamentals/packages/typescript-fundamentals-exercises/node_modules/dts-jest/transform.js" 
      should return an object or a Promise resolving to an object. The object 
      must have `code` property with a string of processed code.
      This error may be caused by a breaking change in Jest 28:
      https://jestjs.io/docs/upgrading-to-jest28#transformer
      Code Transformation Documentation:
      https://jestjs.io/docs/code-transformation

      at ScriptTransformer._buildTransformResult (node_modules/@jest/transform/build/ScriptTransformer.js:507:15)
      at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:628:17)
      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:765:40)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:822:[19])

Test Suites: 1 failed, 4 passed, 5 total
Tests:       5 passed, 5 total
Snapshots:   0 total
Ran all test suites matching /003/i in 4 projects.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It seems like ts-jest also did a similar upgrade here: kulshekhar/ts-jest#3490

@karlhorky
Copy link
Contributor Author

karlhorky commented May 13, 2022

@ikatyang Opened a PR at #410, hope this is the only relevant change from the v27 -> v28 upgrade guide.

ikatyang pushed a commit that referenced this issue May 14, 2022
ikatyang pushed a commit that referenced this issue May 14, 2022
ikatyang pushed a commit that referenced this issue May 14, 2022
ikatyang pushed a commit that referenced this issue May 14, 2022
@karlhorky
Copy link
Contributor Author

Thanks for this @ikatyang !! Upgraded to dts-jest@25.0.0 now and it works with jest@28! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants