3

我完全被卡住了:这是我的目录:

chutzpah.json
src/
--tests/
----example-test.ts
----test.js

//chutzpah.json

{
    "Framework": "mocha",
    "MochaInterface": "bdd",
    "TestHarnessReferenceMode": "AMD",
    "TestHarnessLocationMode": "SettingsFileAdjacent",
    "TypeScriptModuleKind": "AMD",
    "References" : [
        {"Path" : "../../libs/require.js" }, //present, not used yet
        { "Path": "../../node_modules/chai/chai.js", "IsTestFrameworkFile": "true" },
        {"Path" : "./config.js" } //blank, for future use
    ],
    "Tests" : [
      {"Path": "./src/tests"}
    ]
}

//example-test.ts

mocha.setup('bdd');

var expect = chai.expect;
var assert = chai.assert;

describe("MODULE 1", function() {
    it("String doesnt equal number", function() {
        expect('2').to.not.equal(2);
    });
});

//test.js

var expect = chai.expect
describe("A test suite", function () {
    beforeEach(function () {
    });
    afterEach(function () {
    });
    it('should pass', function () {
        expect(true).to.be.true;
    });
});

为什么它不能在 Chutzpah/VS 的测试资源管理器中发现我的 example-test.ts?它确实找到了 test.js?

4

1 回答 1

2

确保将 Visual Studio 插件设置为查找 .ts 文件。工具->选项-> Chutzpah->单元测试资源管理器: 在此处输入图像描述

于 2014-08-21T19:45:05.830 回答