Cant see typescript spec files in test explorer

Juraj Jakubov 21 Reputation points
2023-04-13T15:13:23.0533333+00:00

I have solution with c# projects.
On of these c# projects containt angular application.
There are many tests files with tests. (sometest.spec.ts) - jasmine/karma is used.

Problem is that in test explorer i can see only c# tests.
User's image

I think that checkbox on image is problem there are only C# files. But how can i add ts files too?

Thanks for any suggestions.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,691 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.
331 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 27,811 Reputation points Microsoft Vendor
    2023-04-14T03:27:15.3366667+00:00

    Hello @Juraj Jakubov ,

    Welcome to Microsoft Q&A forum.

    Please try to rebuild the solution/projects and check again.

    For TypeScript, please also check this document: Unit testing JavaScript and TypeScript in Visual Studio

    For TypeScript, do not use the outdir or outfile option in tsconfig.json, because Test Explorer won’t be able to find your unit tests.

    For the option that you mentioned => Test Discovery | Discover tests in real time from C# and Visual Basic .NET source files => it’s an option of a feature called Real-time test discovery. It only works for the managed languages (C# and Visual Basic) since it’s built using the Roslyn compiler. See this document: Real-time test discovery for more details.

    If Test Explorer still doesn’t show the tests, please share us detailed steps to reproduce this issue and check further.

    Feel free to let us know the results.

    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