microsoft / microsoft/nodejstools
Jasmine duplicates test cases to subsequent files
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1.8k
- Forks
- 355
- PR merge metrics
- No merged PRs in 30d
Description
Expected Behavior
Test cases are just listed under the file they exist in
Actual Behavior
Test cases are also listed under all subsequent files
I think the issue might be some form of caching in here.
https://github.com/microsoft/nodejstools/blob/587d04559aaef7288c51ef8420fff67c38257006/Nodejs/Product/TestAdapter/TestFrameworks/Jasmine/jasmine.js#L115-L126
If I move the creation of the jasmine instance (Lines 115+116) inside the forEach, i.e. a new one for each file, the test cases only appear for the correct file.
- NTVS Version: 1.5.20902.1 Commit Hash:b474efcb6f92db52a8f8e2e6a8cb9648476885cc
- Visual Studio Version: 16.8.0 Preview 3.2
- Node.js Version: 10.15.0
- Jasmine: 3.6.1
Steps to Reproduce
- Create a .netstandard project following https://docs.microsoft.com/en-us/visualstudio/javascript/unit-testing-javascript-with-visual-studio?view=vs-2019#unit-test-net-core-and-net-standard
- Add 2 or more test files
- Rebuild project
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 Nodejs/Product/TestAdapter/TestFrameworks/Jasmine/jasmine.js around lines 115-126, where the Jasmine instance is created and files are processed. Reproduce with a .NET Standard project containing two or more test files, then verify that each test case appears only under its own file after rebuilding the project.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100