mmanela / chutzpah

Chutzpah is an open source JavaScript test runner which enables you to run unit tests using QUnit, Jasmine, Mocha and TypeScript.
http://mmanela.github.io/chutzpah/
Apache License 2.0
550 stars 142 forks source link

VS 2017 Unable to run Jasmine Test in MS Test Explorer #608

Closed BAC-Developer closed 7 years ago

BAC-Developer commented 7 years ago

I have attempted to get unit testing working on two different computers with Jasmine/Chutzpah and Visual Studio 2017.

In both cases, the Test Explorer appears to be searching for Unit Tests, the expected test (a sample that will only return success) shows up but I am unable to run the test. After a few seconds the test drops off the list and then reappears, this process repeats. There is a noticeable performance problem while this is occurring in VS.

I opened VS 2015 and setup the same example, and the Test Explorer shows the test and I am able to run the test. Non of the performance issues appear to be happening.

Version Info VS2017 Enterprise Chutzpah Test Adapater: 4.3.4

mmanela commented 7 years ago

Thanks for reporting. I will investigate.

BAC-Developer commented 7 years ago

In trying to diagnose the issue, I have attempted the following.

Full uninstall of VS2017 -> Reboot -> reinstall 2017 and just the Chutzpah components with no change in behavior once the tasks were completed.

HarelM commented 7 years ago

I'm not sure I have the same issue but I was wondering if you had a change to try out Visual Studio 2017 and creating a .Net Core unit project in order to add typesctipt files and run jasmine tests on them. I'm trying to migrate my code to .Net Core and want all the projects to have the same platform (not that I think it might affect anything regarding javascript tests but the new csproj file is very neat).

BAC-Developer commented 7 years ago

I am using a new .net core web project and I also have a Unit Test Project, but the jasmine tests are being ran against files located in the .net core web project. My experience with cross project unit tests for TS/JS has not been pleasant.

mmanela commented 7 years ago

My initial test worked fine. I created a C# project, added some js tests and it ran ok. Do you have a sample for me to use?

BAC-Developer commented 7 years ago

Here is a link to a test project I setup, there is also a screen capture of the issue in action contained in the zip file.

https://www.dropbox.com/s/bh6upjwo3tqfm4l/TestProject.zip?dl=0

mmanela commented 7 years ago

You are missing a chutzpah.json file in your project. Without this chutzpah is trying to traverse your node_modules folder! If you add a chutzpah.json file at the root with the following contents it will work well.

{
    "Compile": {
        "Extensions": [ ".ts" ],
        "ExtensionsWithNoOutput": [ ".d.ts" ]
    },
    "Tests": [
        {
            "Includes": [ "*.spec.ts" ],
            "Excludes": ["*/node_modules/*"]
        }
    ]
}