Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
chore(test): switch to karma
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcrea committed Apr 11, 2013
1 parent b0ffb79 commit aa775b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
14 changes: 7 additions & 7 deletions Gruntfile.js
Expand Up @@ -62,7 +62,7 @@ module.exports = function(grunt) {
// files: '<config:jshint.files>',
// tasks: 'default'
// },
testacular: {
karma: {
test: {
options: {
reporters: ['dots'],
Expand All @@ -75,7 +75,7 @@ module.exports = function(grunt) {
}
},
options: {
configFile: 'test/testacular.conf.js',
configFile: 'test/karma.conf.js',
browsers: ['PhantomJS']
}
}
Expand All @@ -98,17 +98,17 @@ module.exports = function(grunt) {
grunt.registerTask('default', ['test']);

// Test tasks.
grunt.registerTask('test', ['jshint', 'testacular:test']);
grunt.registerTask('test-server', ['testacular:server']);
grunt.registerTask('test', ['jshint', 'karma:test']);
grunt.registerTask('test-server', ['karma:server']);

// Build task.
grunt.registerTask('build', ['test', 'concat', 'uglify']);


// Provides the "testacular" task.
grunt.registerMultiTask('testacular', 'Starts up a testacular server.', function() {
// Provides the "karma" task.
grunt.registerMultiTask('karma', 'Starts up a karma server.', function() {
var done = this.async();
require('testacular').server.start(this.options(), function(code) {
require('karma').server.start(this.options(), function(code) {
done(code === 0);
});
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {},
"devDependencies": {
"testacular": ">= 0.6.0",
"karma": "~ 0.8.0",
"grunt": ">= 0.4.0",
"grunt-contrib-concat": "*",
"grunt-contrib-jshint": "*",
Expand Down
17 changes: 3 additions & 14 deletions test/testacular.conf.js → test/karma.conf.js
Expand Up @@ -6,6 +6,9 @@
// base path, that will be used to resolve files and exclude
basePath = './..';

// frameworks to use
// frameworks = ['jasmine'];

// list of files / patterns to load in the browser
files = [
JASMINE,
Expand All @@ -16,7 +19,6 @@ files = [
'test/lib/angular/angular-mocks.js',
'test/lib/bootstrap.js',
'vendor/bootstrap-datepicker.js',
//'vendor/bootstrap-datepicker.fr.js',
'vendor/bootstrap-timepicker.js',
'src/common.js',
'src/directives/*.js',
Expand All @@ -32,7 +34,6 @@ exclude = [];
// 'coverage',
reporters = ['progress'];


// web server port
// CLI --port 9876
port = 9876;
Expand Down Expand Up @@ -76,15 +77,3 @@ singleRun = false;
// report which specs are slower than 500ms
// CLI --report-slower-than 500
reportSlowerThan = 500;

// compile coffee scripts
preprocessors = {
'src/common.js': 'coverage',
'src/directives/*.js': 'coverage'
//'**/*.coffee': 'coffee'
};

coverageReporter = {
type : 'html',
dir : 'test/coverage/'
};

0 comments on commit aa775b5

Please sign in to comment.