我想運行最基本的TypeScript
測試使用Jasmine
和Chutzpah
,我只是不能得到它的工作。這裏是源文件:簡單的TypeScript測試與Chutzpah不工作
class Simple {
public easyTest() {
return 5;
}
}
這裏是規格:
/// <reference path="../../../scripts/typings/jasmine/jasmine.d.ts" />
/// <reference path="../../../src/typescript/classSimple.ts" />
describe("Simple Calculations",() => {
it("should return true",() => {
var simpl = new Simple();
expect(simpl.easyTest()).toBe(5);
});
});
這裏是我的chutzpah.json
文件:
{
"RootReferencePathMode": "SettingsFileDirectory",
"Framework": "jasmine",
"Compile": {
"Mode": "External",
"Extensions": [ ".ts" ],
"ExtensionsWithNoOutput": [ ".d.ts" ]
},
"References": [
{ "Path": "../../../src/typescript/classSimple.ts" }
],
"Tests": [
{ "Path": "simpleSpec.ts" }
],
"EnableTracing": true
}
這裏是文件夾結構
TestProject.sln
-src
--typescript
---classSimple.ts
-tests
--jasmine
---typescript
----chutzpah.json
----simpleSpec.ts
這VS.NET p roject被設置爲在保存時編譯TypeScript
,並且我在物理上在classSimple.ts
旁邊的完全相同的目錄中查看傳輸的JavaScript
輸出:classSimple.js
。然而,當我運行使用Chutzpah
我得到以下規範:
Message:Chutzpah run started in mode Execution with parallelism set to 4 Message:Building test context for C:\dev\TestProject\tests\jasmine\typescript\simpleSpec.ts Message:Building test context for 'C:\dev\TestProject\tests\jasmine\typescript\simpleSpec.ts' Message:Test file c:\dev\TestProject\tests\jasmine\typescript\simplespec.ts matched test file path from settings file Message:Investigating reference file path '../../../src/typescript/classSimple.ts' Message:Added file 'C:\dev\TestProject\src\typescript\classSimple.ts' to referenced files. Local: True, IncludeInTestHarness: True Message:Processing referenced file 'C:\dev\TestProject\src\typescript\classSimple.ts' for expanded references Message:Added framework dependency 'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\jasmine\v2\jasmine_favicon.png' to referenced files Message:Added framework dependency 'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\jasmine\v2\boot.js' to referenced files Message:Added framework dependency 'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\jasmine\v2\jasmine-html.js' to referenced files Message:Added framework dependency 'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\jasmine\v2\jasmine.js' to referenced files Message:Added framework dependency 'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\jasmine\v2\jasmine.css' to referenced files Message:Added framework dependency 'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\chutzpah_boot.js' to referenced files Message:Finished building test context for C:\dev\TestProject\tests\jasmine\typescript\simpleSpec.ts Error: 0 : Time:22:47:48.6888513; Thread:23; Message:Can't find location for generated path on C:\dev\TestProject\src\typescript\classSimple.ts Warning: 0 : Time:22:47:48.6978503; Thread:23; 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. Information: 0 : Time:22:47:48.7038522; Thread:23; Message:Found generated path for C:\dev\TestProject\tests\jasmine\typescript\simpleSpec.ts at c:\dev\TestProject\tests\jasmine\typescript\simpleSpec.js Error: 0 : Time:22:47:48.7088508; Thread:23; Message:Couldn't find generated path for C:\dev\TestProject\src\typescript\classSimple.ts at
這就是它 - 它只是切斷與結束,沒有任何反應。事情是,我看到了。 js
文件在上述追蹤內規定的位置準確地,但放肆聲稱找不到生成的路徑...
這是因爲它得到了單元測試一樣簡單。我知道測試獨立於.ts
文件工作,因爲如果我運行.js
文件測試通過。
我在做什麼不正確?
我做了一項修改,以確保將來人們不會遇到這個問題:https://github.com/mmanela/chutzpah/commit/9328f3d5f546cecc0ebf8f010b455519324c3de8 –
這很好。感謝您花時間調查並將更新推送到GitHub。我顯然沒有得到這樣的設置。 – atconway