jeudi 30 juillet 2015

JS Unit Test not appearing in VS 2015 Test Explorer

I am new to JavaScript unit testing. I am trying to test typescript classes and my tests are also written in typescript, which somewhat looks like below:

/// <reference path="../../typings/qunit/qunit.d.ts" />
import Utility1 = require("../utility");//This is script I want to test.    

test("utility_test",function() {

    ...

    var result = ...;
    var expected = ...;
    equal(result, expected, "Test failed");
})

I am using VS 2015 with chutzpah test adapter installed as shown here. To be clear I have installed this to extension to vs 2015: Chutzpah Test Runner Context Menu Extension, and Chutzpah Test Adapter for the Test Explorer and also added Chutzpah NuGet package.

Yet when I build my project, the test doesn't appear in the Test Explorer. And when I tried to run the test from context menu, it fails with this error: Error: Error: Called start() outside of a test context while already started.

Can anyone please let me know where I am going wrong?

Aucun commentaire:

Enregistrer un commentaire