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

0 results when using groups runner? #42

Open
wilcoxpdfrd opened this issue May 24, 2022 · 7 comments
Open

0 results when using groups runner? #42

wilcoxpdfrd opened this issue May 24, 2022 · 7 comments

Comments

@wilcoxpdfrd
Copy link

Having a weird issue that just started on my macbook. We've been using this runner for some time with our node projects but recently when I merged a local git project from master, and did an npm update, when I try to run a group of tests:

jest --config ./jest.config.unit.js --collectCoverage --collectCoverageFrom="src/**/*.js" --coverageReporters clover json lcov text text-summary cobertura --coverageDirectory="./coverage" --group=ut --reporters=default --reporters=jest-junit --watchAll=false --verbose --runInBand --forceExit --detectOpenHandles"

I'm just seeing results:

Test Suites: 0 of 9 total
Tests: 0 total
Snapshots: 0 total
Time: 0.456 s, estimated 2 s
Ran all test suites.

The test files include:

/**

So it seems to not recognize the group attribute in the test files perhaps? If I remove the runner: 'groups' from jest.config.unit.js-module.exports json the tests run fine:

Test Suites: 9 passed, 9 total
Tests: 54 passed, 54 total
Snapshots: 0 total
Time: 3.801 s, estimated 44 s
Ran all test suites.

Really stumped; can't find anything online to help. I've tried re-installing the runner and played around with things ... no luck ... And my team mates don't have this issue when they pull my branch. Any thoughts?

Thanks,
Paul

@seanspeaks
Copy link

Same issue 👀

Haven't figured out yet what's happening. Wondering if it's related to versions? I just got to the "oh, they run when commenting out the runner in config" realization

@seanspeaks
Copy link

@wilcoxpdfrd Are you working on a monorepo/with npm workspaces?

I'm finding that when I run npm install with workspaces, groups is failing. When I install in each folder and remove workspaces, I get success.

@seanspeaks
Copy link

Not sure if that's the culprit, I'm going to just tear out and go with regex for now until someone smarter than I can understand what's happening (Feels like modules path/install thing)

@wilcoxpdfrd
Copy link
Author

@seanspeaks Nope, not installing with workspaces ... interesting that would cause the issue we're seeing, but doesn't explain what's happening in my case ...

By regex you mean in jest.config.js testMatch I assume? Interestingly we have also defined regexes to our test folder paths, and I played around with that to see if that could be interfering with groups without success. But no one else on my team sharing our repo has the issue, so that doesn't seem to be the problem either.

@wilcoxpdfrd
Copy link
Author

Got a hint from another engineer who saw this issue on an older version of node, he downgraded npm which fixed the issue for him ... what I did for my project (which I realize now is on node 12 - I'll be addressing upgrading versions soon as I know 12 is EOL) is:

// this selects node v16.0.0 for me
nvm use system

// then
nvm uninstall v12.22.12
nvm install v12.22.12
nvm use v12.22.12

//deleted node_modules folder and package-lock.js in my project, then:

npm i

// then
jest --config ./jest.config.unit.js --collectCoverage --collectCoverageFrom="src/**/*.js" --coverageReporters clover json lcov text text-summary cobertura --coverageDirectory="./coverage" --group=ut --reporters=default --reporters=jest-junit --watchAll=false --verbose --runInBand --forceExit --detectOpenHandles"

// and got
Test Suites: 9 passed, 9 total
Tests: 54 passed, 54 total
Snapshots: 0 total
Time: 5.905 s

Yay!

I'll leave this open for a bit in case the problem comes back or for other comments ...

@MaxGenash
Copy link

I encountered this bug too in jest-runner-groups v2.2.0. Have Node v14.18.2 and npm workspaces.
Downgrading to "jest-runner-groups": "2.1.0" (with the strict fixed version of the library to avoid auto-upgrades) helped to fix the issue for me.

@sschmeck
Copy link

sschmeck commented Jun 27, 2022

We noticed the same issue with jest-runner-groups of version v2.2.0, v2.1.0 after upgrading from Node 14.16.0 to 16.13.0. The tests have been executed with jest version 27.2.3 and ts-jest of version 27.0.5. Upgrading the packages to the latest version solved the issue.

  "devDependencies": {
    "jest": "28.1.1",
    "jest-runner-groups": "2.2.0",
    "ts-jest": "28.0.5"
  }

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

4 participants