I'm trying to get Chutzpah and Jasmine to work together in a visual studio, my ultimate goal is to get unit tests running with TeamCity integration.
When saved, all typescript generate a single file .js. It also makes Chutzpah run my tests as well as it does.
My problem is Chutzpah messages 0 passed, 0 failed and 0 errors. The jasmine html file created by the java compiler correctly decompresses all my tests, but Chutzpa does not seem to get any information from Jasmine.
Trace log basics:
Trying to build test context for c:\.....\test.ts
Building test context for c:\.....\test.ts
...framework dependencies / other ok looking things... (~15 lines)
Finished building test context for c:\.....\test.ts
Warning: 0 : Message:Chutzpah determined generated .js files are missing but the compile
mode is External so Chutzpah can't compile them. Test results may be wrong.
Then it starts Phantom js and registers boot / receive resources. My test.ts file is not one of the listed resources, but on the site .js(I checked the file on the site and my tests are attached to it).
Finished test run for c:\......\test.ts in Discovery mode
Cleaning up test context for c:\......\test.ts
Chutzpah run finished with 0 passed, 0 failed and 0 errors
Chutzpah.json file cache cleared
End Test Adapter Discover Tests
chutzpah.json
{
"Framework": "jasmine",
"EnableTestFileBatching": true,
"Compile": {
"Mode": "External",
"Extensions": [ ".ts" ],
"ExtensionsWithNoOutput": [ ".d.ts" ],
"Paths": [
{
"OutputPath": "../SiteWide.js",
"SourcePath": "Views"
}
]
},
"References": [
{
"Path": "../knockout-3.4.2.js",
"IsTestFrameworkFile": true
}
],
"Tests": [
{
"Includes": [ "*.ts" ],
"Path": "../Tests/Views"
}
],
"EnableTracing": true,
"TraceFilePath": "./trace.log"
}
tests.ts
describe('configuring unit tests for typescript!', () => {
it('this should pass', () => {
expect(1).toBe(1);
});
it('this should fail', () => {
expect(1).toBe(0);
});
});
There are a few things I suspect (a missing line of .js files from the trace), but it could just be caused by my only step of compiling the js file?)
Perhaps I am missing links to jasmine in my chutzpah.json?
I don’t understand why Jasmine’s tests work, but Chutzakh does not report.