microsoft / microsoft/nodejstools

Test explorer doesn't show suite correctly

Open
#2,293 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
1.8k
Forks
355
PR merge metrics
No merged PRs in 30d

Description

Expected Behavior

Javascript tests are displayed in VS Test Explorer by Project > File > Suite > Test

Actual Behavior

The tests output shows the details of file::suite::test

Creating Test Case:tests\FormatServiceTests.js::FormatService - format()::date
Creating Test Case:tests\XAxisTests.js::global::XAxisService.axis() - Index Values

But the test explorer seems to split on the last . and shows js instead of FormatService - format()
and XAxisService > axis() - Index Values instead of global > XAxisService.axis() - Index Values

image
image

These examples are in Jest (26.4.2), but I've seen the same issue trying Jasmine.

FormatServiceTests is using

describe("FormatService - format()", () => {
    test("date", () => {
        ...
    });
});

while
XAxisTests is a top level test

test("XAxisService.axis() - Index Values", () => {
    ...
});
  • NTVS Version: 1.5.20902.1 Commit Hash:b474efcb6f92db52a8f8e2e6a8cb9648476885cc
  • Visual Studio Version: 16.8.0 Preview 3.2
  • Node.js Version: 10.15.0
Steps to reproduce
  1. 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
  2. Add test files into the tests folder and rebuild the project

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the provided .NET Standard project steps, with the Jest or Jasmine examples from the report, and inspect how Visual Studio Test Explorer parses file::suite::test names. Done means the explorer preserves the Project > File > Suite > Test hierarchy, including dotted filenames, suite names, and top-level tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.