Add karma-0.12

This commit is contained in:
tkQubo
2015-09-04 00:24:47 +09:00
parent 85de2eeecf
commit a9ea667231
2 changed files with 50 additions and 0 deletions

24
karma/karma-0.12.d.ts vendored Normal file
View File

@@ -0,0 +1,24 @@
// Type definitions for karma v0.12.37
// Project: https://github.com/karma-runner/karma
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'karma' {
// See Karma public API https://karma-runner.github.io/0.12/dev/public-api.html
interface IKarmaServer {
start(options?: any, callback?: (exitCode: number) => void): void;
}
interface IKarmaRunner {
run(options?: any, callback?: (exitCode: number) => void): void;
}
interface IKarma {
server: IKarmaServer;
runner: IKarmaRunner;
}
var karma: IKarma;
export = karma;
}

26
karma/karma-tests-0.12.ts Normal file
View File

@@ -0,0 +1,26 @@
/// <reference path="karma-0.12.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import gulp = require('gulp');
import karma = require('karma');
function runKarma(singleRun: boolean): void {
karma.server.start({
configFile: __dirname + '/karma.conf.js',
singleRun: singleRun
});
}
gulp.task('test:unit:karma', ['build:test:unit'], () => runKarma(true));
karma.server.start({port: 9876}, (exitCode: number) => {
console.log('Karma has exited with ' + exitCode);
process.exit(exitCode);
});
karma.runner.run({port: 9876}, (exitCode: number) => {
console.log('Karma has exited with ' + exitCode);
process.exit(exitCode);
});