我将 TypeScript 1.0 与 Visual Studio 2012、Chutzpah 3.2.1.1 和 Jasmine 2 一起使用。
我有一个非常基本的测试,使用 Visual Studio Chutzpah 测试适配器运行良好
/// <reference path="../Scripts/typings/jasmine/jasmine.d.ts"/>
describe("x", function(){
it("should", function(){
expect("x").toEqual("x");
});
});
但我希望能够在 TeamCity 上运行测试,所以我创建了一个 MSBuild 文件:
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Chutzpah" ToolsVersion="4.0">
<PropertyGroup>
<ChutzpahPath>..\packages\Chutzpah.3.2.1.1\tools\chutzpah.console.exe</ChutzpahPath>
<TestSourcePath>Spec</TestSourcePath>
</PropertyGroup>
<Target Name="Chutzpah">
<Exec Command="$(ChutzpahPath) $(TestSourcePath)" />
</Target>
</Project>
如果我的所有测试都是用 JavaScript 编写的,则运行良好,但是一旦我添加了上述 TypeScript 测试,我就会收到以下错误:
执行:错误:堆栈空间不足 [config.xml] 运行时:x.ts
如果它有所作为,我的测试在一个 Visual Studio 项目中,而我的 TypeScript 源文件是另一个项目。
如何让我的 TypeScript 测试运行?