本文整理匯總了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
});
});