I am currently working on a project where my project folder contains the following files:
- chai.d.ts
- chai.js
- mocha.d.ts
- mocha.js
- appTest.ts
- appTest.js
- chutzpah.json
The chai and mocha files were acquired through bower and tsd.
Let's take a look at the content of the other files:
appTest.ts:
/// <chutzpah_reference path="mocha.js" />
/// <chutzpah_reference path="chai.js" />
/// <reference path="mocha.d.ts" />
/// <reference path="chai.d.ts" />
var assert = chai.assert;
test("test test", function () {
assert.equal(1, 3, "One equals three");
});
appTest.js: (compiled by external process)
var assert = chai.assert;
test("test test", function () {
assert.equal(1, 3, "One equals three");
});
chutzpah.json:
{
"Compile": {
"Mode": "External",
"Extensions": [ ".ts" ],
"ExtensionsWithNoOutput": [ ".d.ts" ]
},
"Tests": [
{
"Includes": [ "*Test.ts" ]
}
]
}
After running the command below within the folder:
chutzpah.console appTest.ts
An error is encountered as shown:
Chutzpah console test runner (64-bit .NET 4.0.30319.42000)
Version 4.1.0.0
Copyright (C) 2015 Matthew Manela (http://matthewmanela.com).
Error: ReferenceError: Can't find variable: chai
at global code in file:///C:/***/appTest.js (line 1)
While Running:C:\***\appTest.ts
File: C:\***\appTest.ts
0 total, 0 failed, took 0.00 seconds
Tests complete: 0
=== 0 total, 0 failed, took 1.65 seconds ===
What could be the missing piece in this puzzle?