Test Explorer does not find UnitTests in the newly created Angular/React project (.esproj)

Daniel Breul 0 Reputation points
2023-07-13T12:40:08.45+00:00

I have created a new Angular project using Visual Studio 2022.

This automatically creates a demo project that also contains a test file with some tests (app.component.spec.ts).

My problem is that the test explorer does not find the tests.

I have rebuilt the project many times. Also I created my own test file and wrote a test - without success. The tests are simply not found.

The output shows the following errors:User's image

I can't understand this because my project has a different GUID. Why does the test explorer search for it? Furthermore, in another Angular project, also newly created, it is also looking for the same GUID. In another, Angular project I got the following error:

User's image

I then created a new React project - with the same result.

I would be very grateful for any help!

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,180 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
351 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 31,086 Reputation points Microsoft Vendor
    2023-07-14T06:31:01.5933333+00:00

    Hello @Daniel Breul ,

    Welcome to Microsoft Q&A forum.

    I recommend directly reporting this issue on our Developer Community for further check.

    Currently, you may try to use commands to test the tests by opening Developer Command Prompt for Visual Studio 2022, using "cd" command to navigate to your project folder, and then run npm test command.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.