Skip to content

Commit 0d09b8b

Browse files
committed
Fixed gruntfile and Package.json.
1 parent 4c49413 commit 0d09b8b

File tree

3 files changed

+53
-40
lines changed

3 files changed

+53
-40
lines changed

Gruntfile.js

+42-33
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var testacular = require('testacular');
1+
//var testacular = require('testacular');
22

33
/*global module:false*/
44
module.exports = function (grunt) {
@@ -9,7 +9,8 @@ module.exports = function (grunt) {
99
grunt.loadNpmTasks('grunt-contrib-jshint');
1010
grunt.loadNpmTasks('grunt-contrib-watch');
1111
grunt.loadNpmTasks('grunt-contrib-connect');
12-
12+
grunt.loadNpmTasks('grunt-karma');
13+
1314
// Project configuration.
1415
grunt.initConfig({
1516
builddir: 'build',
@@ -55,44 +56,52 @@ module.exports = function (grunt) {
5556
},
5657
watch: {
5758
files: ['src/*.js', 'test/**/*.js'],
58-
tasks: ['build', 'test']
59+
tasks: ['build','karma:unit']
5960
},
60-
connect: {
61-
server: {}
62-
}
61+
// connect: {
62+
// server: {}
63+
// },
64+
karma: {
65+
unit: {
66+
configFile: 'test/test-config.js',
67+
runnerPort: 9999,
68+
singleRun: true,
69+
browsers: ['PhantomJS']
70+
}
71+
}
6372
});
6473

65-
grunt.registerTask('default', ['build', 'jshint', 'test']);
74+
grunt.registerTask('default', ['build', 'jshint', 'karma:unit']);
6675
grunt.registerTask('build', 'Perform a normal build', ['concat', 'uglify']);
6776
grunt.registerTask('dist', 'Perform a clean build and generate documentation', ['clean', 'build', 'jsdoc']);
68-
grunt.registerTask('dev', 'Run dev server and watch for changes', ['build', 'connect', 'watch']);
77+
grunt.registerTask('dev', 'Run dev server and watch for changes', ['build', 'watch']);
6978

70-
grunt.registerTask('test-server', 'Start testacular server', function () {
71-
//Mark the task as async but never call done, so the server stays up
72-
var done = this.async();
73-
testacular.server.start({ configFile: 'test/test-config.js'});
74-
});
79+
// grunt.registerTask('test-server', 'Start testacular server', function () {
80+
// //Mark the task as async but never call done, so the server stays up
81+
// var done = this.async();
82+
// testacular.server.start({ configFile: 'test/test-config.js'});
83+
// });
7584

76-
grunt.registerTask('test', 'Run tests (make sure test-server task is run first)', function () {
77-
var done = this.async();
78-
grunt.util.spawn({
79-
cmd: process.platform === 'win32' ? 'testacular.cmd' : 'testacular',
80-
args: process.env.TRAVIS ? ['start', 'test/test-config.js', '--single-run', '--no-auto-watch', '--reporter=dots', '--browsers=Firefox'] : ['run']
81-
}, function (error, result, code) {
82-
if (error) {
83-
grunt.warn("Make sure the testacular server is online: run `grunt test-server`.\n" +
84-
"Also make sure you have a browser open to http://localhost:8080/.\n" +
85-
error.stdout + error.stderr);
86-
//the testacular runner somehow modifies the files if it errors(??).
87-
//this causes grunt's watch task to re-fire itself constantly,
88-
//unless we wait for a sec
89-
setTimeout(done, 1000);
90-
} else {
91-
grunt.log.write(result.stdout);
92-
done();
93-
}
94-
});
95-
});
85+
// grunt.registerTask('test', 'Run tests (make sure test-server task is run first)', function () {
86+
// var done = this.async();
87+
// grunt.util.spawn({
88+
// cmd: process.platform === 'win32' ? 'karma.cmd' : 'karma',
89+
// args: process.env.TRAVIS ? ['start', 'test/test-config.js', '--single-run', '--no-auto-watch', '--reporter=dots', '--browsers=Firefox'] : ['run']
90+
// }, function (error, result, code) {
91+
// if (error) {
92+
// grunt.warn("Make sure the testacular server is online: run `grunt test-server`.\n" +
93+
// "Also make sure you have a browser open to http://localhost:8080/.\n" +
94+
// error.stdout + error.stderr);
95+
// //the testacular runner somehow modifies the files if it errors(??).
96+
// //this causes grunt's watch task to re-fire itself constantly,
97+
// //unless we wait for a sec
98+
// setTimeout(done, 1000);
99+
// } else {
100+
// grunt.log.write(result.stdout);
101+
// done();
102+
// }
103+
// });
104+
// });
96105

97106
grunt.registerTask('jsdoc', 'Generate documentation', function () {
98107
var done = this.async();

package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
"name": "Karsten Sperling",
88
"url": "https://github.com/ksperling"
99
},
10-
"contributors": [{
11-
"name": "AngularUI",
12-
"url": "https://github.com/angular-ui?tab=members"
13-
}],
10+
"contributors": [
11+
{
12+
"name": "AngularUI",
13+
"url": "https://github.com/angular-ui?tab=members"
14+
}
15+
],
1416
"repository": {
1517
"type": "git",
1618
"url": "https://github.com/angular-ui/ui-router.git"
@@ -26,14 +28,15 @@
2628
],
2729
"dependencies": {},
2830
"devDependencies": {
29-
"karma": "~0.8.3",
3031
"jsdoc": "git://github.com/jsdoc3/jsdoc.git#v3.1.0",
3132
"grunt": "~0.4.1",
3233
"grunt-contrib-concat": "~0.1.3",
3334
"grunt-contrib-uglify": "~0.2.0",
3435
"grunt-contrib-jshint": "~0.3.0",
3536
"grunt-contrib-watch": "~0.3.1",
3637
"grunt-contrib-connect": "~0.2.0",
37-
"grunt-contrib-clean": "~0.4.0"
38+
"grunt-contrib-clean": "~0.4.0",
39+
"grunt-karma": "~0.3.0",
40+
"underscore": "~1.4.4"
3841
}
3942
}

src/urlRouter.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

22
$UrlRouterProvider.$inject = ['$urlMatcherFactoryProvider'];
33
function $UrlRouterProvider( $urlMatcherFactory) {
4-
var rules = [], otherwise = null;
4+
var rules = [],
5+
otherwise = null;
56

67
// Returns a string that is a prefix of all strings matching the RegExp
78
function regExpPrefix(re) {

0 commit comments

Comments
 (0)