Permalink
Browse files

Test with grunt

  • Loading branch information...
1 parent b68b4f3 commit 84867a0a2c4d51e482a68b8337d3365b4c618cf1 @geigerzaehler geigerzaehler committed Oct 11, 2013
Showing with 29 additions and 19 deletions.
  1. +27 −11 Gruntfile.js
  2. +0 −3 Makefile
  3. +2 −1 package.json
  4. +0 −4 test/mocha.opts
View
38 Gruntfile.js
@@ -1,22 +1,38 @@
var connect = require('connect');
module.exports = function(grunt) {
+ grunt.initConfig({
+ simplemocha: {
+ options: {
+ ignoreLeaks: true,
+ ui: 'bdd',
+ reporter: 'spec'
+ },
+ all: [
+ 'test/**/*_spec.coffee',
+ 'test/**/*_spec.js'
+ ]
+ }
+ });
+
+ grunt.loadTasks('tasks');
+ grunt.loadNpmTasks('grunt-simple-mocha');
- grunt.loadTasks('tasks')
+ grunt.registerTask('test', ['simplemocha']);
grunt.registerTask('test:server', 'Start a server to test clients', function(){
var done = this.async();
server = require('./test/helpers/server')();
server.listen(3000)
- .on('listening', function() {
- grunt.log.writeln('To test clients go to http://localhost:3000');
- })
- .on('error', function(err) {
- if (err.code === 'EADDRINUSE') {
- grunt.fatal('Port 3000 is already in use by another process.');
- } else {
- grunt.fatal(err);
- }
- });
+ .on('listening', function() {
+ grunt.log.writeln('To test clients go to http://localhost:3000');
+ })
+ .on('error', function(err) {
+ if (err.code === 'EADDRINUSE') {
+ grunt.fatal('Port 3000 is already in use by another process.');
+ } else {
+ grunt.fatal(err);
+ }
+ });
});
};
View
3 Makefile
@@ -28,9 +28,6 @@ all: webclient
clean:
rm -rf webclient/*
-test:
- node_modules/.bin/mocha
-
webclient/share.uncompressed.js: $(BUNDLED_TYPES) $(CLIENT_SRCS)
mkdir -p webclient
echo '(function(){' > $@
View
3 package.json
@@ -36,6 +36,7 @@
"chai": "*",
"sinon": "1.7.3",
"phantom-proxy": "~0.1.792",
+ "grunt-simple-mocha": "~0.4.0",
"uglify-js": "~2"
},
"engine": "node >= 0.10",
@@ -45,7 +46,7 @@
},
"scripts": {
"build": "make",
- "test": "mocha",
+ "test": "grunt test",
"prepublish": "make webclient"
},
"licenses": [
View
4 test/mocha.opts
@@ -1,4 +0,0 @@
-test/**/*_spec.coffee
---compilers coffee:coffee-script
---reporter spec
---check-leaks

0 comments on commit 84867a0

Please sign in to comment.