test list gets screwed up when multiple tests have the same name but are in different describe blocks
See original GitHub issueIs this a bug report or a feature request?
bug
Version Info
- Version of Majestic: v1.6.2
- Version of Jest:
- Version of Node:
- Operating System:
Reproduction Repo
Create a unit test with two describe blocks and each describe block place the a test with the same name.
describe('block 1', () => {
it('test name', () => {
expect(true).toBeTruthy();
})
}
describe('block 2', () => (
it('test name', () => {
expect(false).toBeTruthy();
})
}
What you will see is the proper display of two describe blocks, each with one test in it, but both tests will show as passing, even though the second one fails.
I assume that you are using the test name as a unique key, which can’t be assumed.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
having multiple describe in spec leads to weird behaviour
If they are related put them both nested inside an additional describe and add a string that describes what you're about to test...
Read more >Is it OK to have multiple asserts in a single unit test?
The key is that you have only one action, and then you inspect the results of that action using asserts. But it is...
Read more >Jest Testing like a Pro - Tips and tricks
When you run Jest, tests are run by file, within that file you can have groups of related tests, which you put under...
Read more >Structuring Tests - Node Tap
There are two tools that you can use to organize your tests so that they help in this process: test files (aka suites)...
Read more >Unit Tests, How to Write Testable Code, and Why It Matters
After finishing a test, the mad scientist cleans up all the dirt, sand and rocks that are now scattered in his lovely laboratory....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@zeevrosental if you want a version that fixes this issue, you can build my fork. It is now up to date with the latest changes from the main fork and it includes few extra enhancements that I will do separate PRs for if this original code is accepted.
hi!, any reason why this wasn’t merged yet?