本文整理汇总了TypeScript中mocha.addFile函数的典型用法代码示例。如果您正苦于以下问题:TypeScript addFile函数的具体用法?TypeScript addFile怎么用?TypeScript addFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addFile函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
}).forEach(function (file) {
mocha.addFile(
path.join(testDir, file)
);
});
示例2: require
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const MochaTest = require('mocha');
const mochaTest = new MochaTest({
timeout: 60000,
slow: 10000,
useColors: true
});
mochaTest.addFile(require('path').join(process.cwd(), 'out/test.js'));
mochaTest.run((failures) => {
process.exit(failures);
});
示例3:
_.forEach(testFiles, (testFile) => mocha.addFile(testFile));
示例4:
files.forEach(function(file) {
testRunner.addFile(file);
});
示例5: require
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const MochaTest = require('mocha');
const path = require('path');
const mochaTest = new MochaTest({
timeout: 360000,
retries: 2,
slow: 50000,
useColors: true
});
mochaTest.addFile(path.join(process.cwd(), 'out/test.js'));
mochaTest.run((failures) => {
process.exit(failures);
});
示例6: require
process.env.TS_NODE_PROJECT = './tsconfig.spec.json';
import 'reflect-metadata';
require('ts-mocha');
const Mocha = require('mocha');
const mocha = new Mocha();
mocha.addFile(`./tests-ssr/todo.mocha.ts`);
mocha.addFile(`./tests-ssr/exit.mocha.ts`);
mocha.run((failures: number) => {
process.on('exit', () => {
process.exit(failures); // exit with non-zero status if there were failures
});
});