testing-library / testing-library/user-event
Running tests failed with "Error: No active group"
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Description
Reproduction example
cannot be reproduced by codesandbox
Prerequisites
As I researched the root cause of this error, I would like to report it without reproduction steps.
In the 14.x version of User-event, this line of the Clipboard.ts file will cause Jasmine to install an afterAll hook unexpectedly. When a normal test suite is completed, Jasmine will try to call this callback without an active group.
Expected behavior
Tests run without errors.
Actual behavior
Test suite failed to run
Error: No active group
at JasmineAllureReporter.get currentGroup [as currentGroup] (node_modules/allure-jasmine/src/JasmineAllureReporter.ts:50:38)
at node_modules/allure-jasmine/src/JasmineAllureReporter.ts:250:54
at Object.<anonymous> (node_modules/allure-jasmine/src/JasmineAllureReporter.ts:220:40)
User-event version
14.4.3
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
Additional context
Only failed with using allure-jasmine to generate reports.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/utils/dataTransfer/Clipboard.ts line 220 and inspect how the afterAll hook is installed when allure-jasmine is present. Run the relevant test suite with the reported user-event 14.4.3 and Jest setup; done means tests complete without the Error: No active group failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100