本文整理匯總了TypeScript中karma.server.start方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript server.start方法的具體用法?TypeScript server.start怎麽用?TypeScript server.start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類karma.server
的用法示例。
在下文中一共展示了server.start方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
return function (done) {
karma.start({
configFile: join(process.cwd(), 'karma.conf.js'),
singleRun: true,
}, function() {
done();
});
};
示例2: start_mock_server
gulp.task('test-browser', ['tsc'], (done) => {
var server = start_mock_server()
karma.start({
configFile: __dirname + '/karma.conf.ts',
webpack: _.assign(webpackConfig,{
debug: true
})
}, () => {
server.kill('SIGINT')
done()
})
})
示例3: startKarma
function startKarma(conf, next) {
karma.server.start(conf, function (exitCode) {
// exit code === 0 is OK
if (!exitCode) {
console.log('\tTests ran successfully.\n');
// rerun with a different configuration
next();
} else {
// just exit with the error code
next(exitCode);
}
});
}
示例4: startTests
function startTests(singleRun: boolean, done: any) {
'use strict';
var karma = require('karma').server;
var excludeFiles = [];
var serverSpecs = config.serverIntegrationSpecs;
excludeFiles = serverSpecs;
karma.start({
configFile: __dirname + '/karma.conf.js',
exclude: excludeFiles,
singleRun: singleRun
}, karmaCompleted);
function karmaCompleted(karmaResult: any) {
console.log('Karma completed!');
if (karmaResult === 1) {
done('karma: tests failed with code ' + karmaResult);
} else {
done();
}
}
}
示例5: Promise
var promise:any = new Promise(function(resolve:any, reject:any) {
server.start(config, function(){
resolve(this);
});
});