Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

jest plugin: runner and reporter are not exported correctly #1

Closed
SevInf opened this issue Feb 7, 2023 · 1 comment
Closed

jest plugin: runner and reporter are not exported correctly #1

SevInf opened this issue Feb 7, 2023 · 1 comment

Comments

@SevInf
Copy link

SevInf commented Feb 7, 2023

Instructions say to run jest with the following flags:

--reporters @unflakable/jest-plugin/dist/reporter
--runner @unflakable/jest-plugin/dist/runner

At least as of Jest 29/Node 18 combination, this fails with:

Error: Could not resolve a module for a custom reporter.
  Module name: @unflakable/jest-plugin/dist/reporter

and:

Jest Runner @unflakable/jest-plugin/dist/runner cannot be found. Make sure the runner configuration option points to an existing node module.

At first it might seem that the plugin is not installed, however, it is there. Attempt to call require.resolve manually resolve the module produces more helpful message:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/runner' is not defined by "exports" in ./prisma/packages/client/node_modules/@unflakable/jest-plugin/package.json

So, the problem actual problem is: plugin is published as ESM, but export section does not exports runner and reporter submodules.

@ramosbugs
Copy link
Member

Hi @SevInf,

Thank you for reporting this issue!

Currently, the Unflakable Jest plugin is only compatible with Jest versions up to 27. There were significant breaking changes in Jest 28 and 29 that we haven't had a chance to support properly. It looks like this particular issue was introduced by jestjs/jest#11961, but there were other breaking changes that are more challenging to address.

We definitely plan to add support for the latest Jest releases, but we don't have a specific release timeframe yet. In the meantime, we recommend using Jest 27 if it meets your other requirements.

ramosbugs added a commit that referenced this issue Jul 29, 2023
This should support GitHub Actions `pull_request` events.
ramosbugs added a commit that referenced this issue Jul 29, 2023
Beginning in Jest 28 (see jestjs/jest#11961),
Jest expects modules to be explicitly exported.

Fixes #1.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants