Skip to content

While using KarmaTestAdapter, the failed unit test not showing as failed in visual studio #2

@mstephano

Description

@mstephano

Hi,

I am using KarmaTestAdapter, and my failed Jasmine unit test was showing under "Not Run Tests" in the Test Explorer of Visual Studio 2013. Selecting the test and trying to "Run Selected Tests" was doing nothing in Visual Studio, not even showing the Karma error message in the bottom part of Test Explorer.

So I had to debug KarmaTestAdapter, the bug is in JsTestAdapter under "JsTestAdapter.TestAdapter.TestRunner.GetResult()" line 222. It seams that failure.stack is null, so the fix is to replace line 222 to this:

testResult.ErrorStackTrace = string.Join(Environment.NewLine, failure.stack ?? (new List<string>()));

Also, line 226 gave me an error because extraFailure.stack is also null, so replace line 226 to this:

string.Join(Environment.NewLine, extraFailure.message, string.Join(Environment.NewLine, extraFailure.stack ?? (new List<string>())))

I deployed the fix locally and it worked. Can you please fix it and make a new redistribution package? My whole team is using your Extension (thank you very much for that) and the fix can probably help others than only my team.

Best regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions