mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-01-12 22:45:52 +08:00
chore: use Karma
This commit is contained in:
12
Gruntfile.js
12
Gruntfile.js
@@ -45,17 +45,17 @@ module.exports = function(grunt) {
|
||||
|
||||
|
||||
test: {
|
||||
jqlite: 'testacular-jqlite.conf.js',
|
||||
jquery: 'testacular-jquery.conf.js',
|
||||
modules: 'testacular-modules.conf.js',
|
||||
jqlite: 'karma-jqlite.conf.js',
|
||||
jquery: 'karma-jquery.conf.js',
|
||||
modules: 'karma-modules.conf.js',
|
||||
//NOTE run grunt test:e2e instead and it will start a webserver for you
|
||||
end2end: 'testacular-e2e.conf.js'
|
||||
end2end: 'karma-e2e.conf.js'
|
||||
},
|
||||
|
||||
|
||||
autotest: {
|
||||
jqlite: 'testacular-jqlite.conf.js',
|
||||
jquery: 'testacular-jquery.conf.js'
|
||||
jqlite: 'karma-jqlite.conf.js',
|
||||
jquery: 'karma-jquery.conf.js'
|
||||
},
|
||||
|
||||
|
||||
|
||||
2
angularFiles.js
vendored
2
angularFiles.js
vendored
@@ -208,7 +208,7 @@ if (exports) {
|
||||
var files = [];
|
||||
|
||||
[].splice.call(arguments, 0).forEach(function(file) {
|
||||
if (file.match(/testacular/)) {
|
||||
if (file.match(/karma/)) {
|
||||
files.push(file);
|
||||
} else {
|
||||
angularFiles[file].forEach(function(f) {
|
||||
|
||||
@@ -50,12 +50,12 @@ module.exports = function(grunt) {
|
||||
});
|
||||
|
||||
|
||||
grunt.registerMultiTask('test', 'Run the unit tests with testacular', function(){
|
||||
util.startTestacular.call(util, this.data, true, this.async());
|
||||
grunt.registerMultiTask('test', 'Run the unit tests with Karma', function(){
|
||||
util.startKarma.call(util, this.data, true, this.async());
|
||||
});
|
||||
|
||||
|
||||
grunt.registerMultiTask('autotest', 'Run and watch the unit tests with testacular', function(){
|
||||
util.startTestacular.call(util, this.data, false, this.async());
|
||||
grunt.registerMultiTask('autotest', 'Run and watch the unit tests with Karma', function(){
|
||||
util.startKarma.call(util, this.data, false, this.async());
|
||||
});
|
||||
};
|
||||
|
||||
@@ -30,11 +30,11 @@ module.exports = {
|
||||
},
|
||||
|
||||
|
||||
startTestacular: function(config, singleRun, done){
|
||||
startKarma: function(config, singleRun, done){
|
||||
var browsers = grunt.option('browsers');
|
||||
var reporters = grunt.option('reporters');
|
||||
var noColor = grunt.option('no-colors');
|
||||
var p = spawn('node', ['node_modules/testacular/bin/testacular', 'start', config,
|
||||
var p = spawn('node', ['node_modules/karma/bin/karma', 'start', config,
|
||||
singleRun ? '--single-run=true' : '',
|
||||
reporters ? '--reporters=' + reporters : '',
|
||||
browsers ? '--browsers=' + browsers : '',
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"q-fs": "0.1.36",
|
||||
"qq": "0.3.5",
|
||||
"shelljs": "0.1.2",
|
||||
"testacular": "0.5.9",
|
||||
"karma": "~0.8",
|
||||
"yaml-js": "0.0.5"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user