I've got a fairly simple repro with an outcome I don't understand.
Make sure you have the Chutpah Test Adapter 4.0.3 installed. Using Visual Studio 2013 take the following steps:
- Create a new .NET 4.5.1 class library project;
- Add the NuGet package
qunit.TypeScript.DefinitelyTyped
0.1.7; Add a TypeScript file
file1.ts
to the project with this content:/// <reference path="./Scripts/typings/qunit/qunit.d.ts"/> QUnit.test("QUnit is working", assert => assert.ok(true));
Right-click inside that file and pick "Run JS Tests" from the context menu.
I can confirm that file1.js
is generated as expected.
The result is that no tests are run, the test explorer shows no tests, and the Test output shows:
Error: Error: Called start() outside of a test context while already started
at start in file:///C:/Users/username/AppData/Local/Microsoft/VisualStudio/12.0/Extensions/abcxyz/TestFiles/QUnit/qunit.js (line 287)
at startQUnit in phantomjs://webpage.evaluate() (line 12)
at onPageLoaded in phantomjs://webpage.evaluate() (line 16)
in phantomjs://webpage.evaluate() (line 18)
While Running:c:\users\username\documents\visual studio 2013\Projects\ClassLibrary3\ClassLibrary3\file1.ts
------ Test started: File: c:\users\username\documents\visual studio 2013\Projects\ClassLibrary3\ClassLibrary3\file1.ts ------
Error: Error: Called start() outside of a test context while already started
While Running:c:\users\username\documents\visual studio 2013\Projects\ClassLibrary3\ClassLibrary3\file1.ts
0 passed, 0 failed, 0 total (chutzpah).
========== Total Tests: 0 passed, 0 failed, 0 total ==========
If I choose the "Open In Browser" Chutzpah context menu item I get a regular QUnit test page, nicely formatted, showing zero tests run.
Obviously the expected result was that one test was successfully run.
What am I missing here?