Skip to content

Commit

Permalink
added test setup, #1
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnR committed Jul 30, 2014
1 parent ffc886e commit 2772361
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
before_script:
- npm install -g grunt-cli
10 changes: 9 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ module.exports = function( grunt ) {
}
}
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: [ 'test/**/*.spec.js' ]
}
},
jsbeautifier: {
test: {
src: [ "**/*.js", "!node_modules/**" ],
Expand All @@ -94,7 +102,7 @@ module.exports = function( grunt ) {
},
} );

grunt.registerTask( 'test', [ 'jshint', 'jsbeautifier:test' ] );
grunt.registerTask( 'test', [ 'jshint', 'jsbeautifier:test', 'mochaTest' ] );
grunt.registerTask( 'build', [ 'sass' ] );
grunt.registerTask( 'develop', [ 'concurrent:develop' ] );
grunt.registerTask( 'default', [ 'jshint', 'jsbeautifier:test' ] );
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"private": false,
"main": "./app.js",
"scripts": {
"start": "node app.js"
"start": "node app.js",
"test": "grunt test"
},
"dependencies": {
"body-parser": "^1.4.3",
Expand All @@ -20,15 +21,19 @@
"serve-favicon": "~2.0.1"
},
"devDependencies": {
"chai": "^1.9.1",
"chai-as-promised": "^4.1.1",
"grunt": "~0.4.5",
"grunt-concurrent": "^0.5.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-develop": "^0.4.0",
"grunt-jsbeautifier": "^0.2.7",
"grunt-mocha-test": "^0.11.0",
"grunt-nodemon": "^0.3.0",
"grunt-sass": "^0.14.0",
"load-grunt-tasks": "~0.6.0",
"mocha": "^1.21.3",
"request": "~2.36.0",
"time-grunt": "~0.3.2"
}
Expand Down
23 changes: 23 additions & 0 deletions test/form-model.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* global describe, require, it, before, after, beforeEach, afterEach */
"use strict";

var Q = require( "q" ),
chai = require( "chai" ),
expect = chai.expect,
chaiAsPromised = require( "chai-as-promised" ),
config = require( "../config/config" ),
model = require( '../app/models/form' );

chai.use( chaiAsPromised );

describe( 'Form Model', function() {

before( function() {} );

afterEach( function() {} );

it( 'requires comprehensive testing', function() {
return expect( true ).to.equal( true );
} );

} );
24 changes: 24 additions & 0 deletions test/utils-lib.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* global describe, require, it, before, after, beforeEach, afterEach */
"use strict";

var //Q = require( "q" ),
chai = require( "chai" ),
expect = chai.expect,
utils = require( '../app/lib/utils' );
//chaiAsPromised = require( "chai-as-promised" ),
//config = require( "../config/config" ),
//model = require( '../app/models/form' );

//chai.use( chaiAsPromised );

describe( 'Utils library', function() {

before( function() {} );

afterEach( function() {} );

it( 'requires comprehensive testing', function() {
return expect( true ).to.equal( true );
} );

} );

0 comments on commit 2772361

Please sign in to comment.