代码拉取完成,页面将自动刷新
/* eslint-disable @typescript-eslint/no-var-requires */
/**
* Run all tests: `npm run tdd`
* Run all styles tests: `M=styles npm run tdd`
* Run a component test: `M=Button npm run tdd`
* Run a test of a file: `F=src/Picker/test/PickerToggleSpec.tsx npm run tdd`
*/
/**
* @param {import('karma').Config} config
*/
module.exports = config => {
const { env } = process;
const { M, F } = env;
// Weird pattern syntax but works
// @see https://github.com/karma-runner/karma/issues/1532#issuecomment-127128326
let testFile = 'src/**/*Spec.+(js|ts|tsx)';
if (M) {
testFile = `src/${M}/test/*Spec.+(js|ts|tsx)`;
} else if (F) {
testFile = F;
}
config.set({
/** Timeout for capturing a browser (in ms). */
captureTimeout: 210000,
/** maximum number of tries a browser will attempt in the case of a disconnection (in ms) */
browserDisconnectTolerance: 3,
/** How long does Karma wait for a browser to reconnect (in ms). */
browserDisconnectTimeout: 210000,
/** How long will Karma wait for a message from a browser before disconnecting from it (in ms). */
browserNoActivityTimeout: 210000,
basePath: '',
files: ['test/setupTests.js', ...[testFile].map(pattern => ({ pattern, watched: false }))],
frameworks: ['mocha', 'chai-dom', 'sinon-chai', 'webpack'],
colors: true,
reporters: ['mocha', 'coverage'],
logLevel: config.LOG_INFO,
preprocessors: {
'test/setupTests.js': ['webpack'],
'src/**/*Spec.+(js|ts|tsx)': ['webpack']
},
client: {
mocha: {
timeout: 10000 // default 2000
}
},
webpack: require('./webpack.karma.js'),
webpackMiddleware: {
noInfo: true
},
browsers: env.BROWSER ? env.BROWSER.split(',') : ['Chrome'],
customLaunchers: {
ChromeCi: {
base: 'Chrome',
flags: ['--no-sandbox']
},
FirefoxAutoAllowGUM: {
base: 'Firefox',
prefs: {
'media.navigator.permission.disabled': true
}
}
},
coverageReporter: {
dir: 'coverage',
reporters: [
{ type: 'html' },
{ type: 'lcov', subdir: 'lcov' } // lcov
]
}
});
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。