本文整理匯總了TypeScript中karma.server類的典型用法代碼示例。如果您正苦於以下問題:TypeScript server類的具體用法?TypeScript server怎麽用?TypeScript server使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了server類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: 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()
})
})
示例2: 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);
}
});
}
示例3: 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();
}
}
}
示例4: Promise
var promise:any = new Promise(function(resolve:any, reject:any) {
server.start(config, function(){
resolve(this);
});
});
示例5: function
return function (done) {
karma.start({
configFile: join(process.cwd(), 'karma.conf.js'),
singleRun: true,
}, function() {
done();
});
};