gpt4 book ai didi

c# - 如何让 Chutzpah 发现 Typescript 文件?

转载 作者:行者123 更新时间:2023-11-30 16:58:19 25 4
gpt4 key购买 nike

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

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);
});
});

//测试.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?

最佳答案

确保 visual studio 插件设置为查找 .ts 文件。工具->选项->大胆->单元测试资源管理器: enter image description here

关于c# - 如何让 Chutzpah 发现 Typescript 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25413112/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com