本文整理匯總了TypeScript中gulp-karma.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了default函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
gulp.task('watch', () => {
gulp.src('non_existing_file.js').pipe(karma({
configFile: 'karma.conf.js',
action: 'watch'
}));
gulp.watch(paths.scripts_ts, ['tslint']);
});
示例2: function
gulp.task('test', ['compile-typescript'], () => {
// Be sure to return the stream
return gulp.src(testFiles)
.pipe(karma({
configFile: 'karma.conf.js',
action: 'run'
}))
.on('error', function(err) {
// Make sure failed tests cause gulp to exit non-zero
throw err;
});
});
示例3:
() => {
return gulp.src([
DEST_DIR + '/' + DEBUGGER_NAMESPACE + '/vendor.js',
DEST_DIR + '/' + DEBUGGER_NAMESPACE + '/scripts.js',
TEMP_DIR + '/' + DEBUGGER_NAMESPACE + '/**/*.spec.js'
])
.pipe(karma({
configFile: 'debugger-ci.conf.js',
action: 'run'
}))
.on('error', (err) => {
throw err;
});
});
示例4: testWithCodeCoverage
function testWithCodeCoverage(srcFiles: string[], instrumentedFile: string, coverageOutputFile: string) {
let preprocessors = {};
preprocessors[instrumentedFile] = ['sourcemap', 'coverage'];
return gulp
.src(srcFiles)
.pipe(karma({
configFile: 'unit.conf.js',
preprocessors: preprocessors,
basePath: '.',
coverageReporter: {
type: 'clover',
dir: CODE_COVERAGE_DIR,
basePath: '.',
subdir: '.',
file: coverageOutputFile
},
action: 'run'
}))
.on('error', function(err) {
throw err;
});
}