Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating tests, adding JSHint

  • Loading branch information...
commit d3668248e525374ed76b2909b0502cc982fe24b8 1 parent bf278b8
@daffl authored
Showing with 39 additions and 30 deletions.
  1. +13 −0 .jshintrc
  2. +22 −27 Gruntfile.js
  3. +3 −2 package.json
  4. +1 −1  test/test.js
View
13 .jshintrc
@@ -0,0 +1,13 @@
+{
+ "globals": {
+ "it": true,
+ "describe": true,
+ "before": true,
+ "after": true,
+ "exports": true
+ },
+ "eqnull": true,
+ "node": true,
+ "unused": true,
+ "undef": true
+}
View
49 Gruntfile.js
@@ -2,35 +2,30 @@
module.exports = function(grunt) {
- // Project configuration.
- grunt.initConfig({
- jshint: {
- all: {
- src: ['grunt.js', 'tasks/**/*.js', 'lib/**/*.js', 'test/**/*.js'],
- options: {
- curly: true,
- eqeqeq: true,
- immed: true,
- latedef: true,
- newcap: true,
- noarg: true,
- sub: true,
- undef: true,
- boss: true,
- eqnull: true,
- node: true
- },
- globals: {
- exports: true
- }
- }
- },
+ // Project configuration.
+ grunt.initConfig({
+ simplemocha: {
+ options: {
+ timeout: 5000
+ },
+ app: {
+ src: ['test/**/*.js']
+ }
+ },
+ jshint: {
+ options: {
+ jshintrc: '.jshintrc'
+ },
+ lib: ['lib/**/*.js', 'Gruntfile.js'],
+ test: ['test/**/*.js']
+ },
release: {}
- });
+ });
- // Default task.
- grunt.registerTask('default', 'jshint');
+ grunt.registerTask('default', 'test');
+ grunt.registerTask('test', [ 'jshint', 'simplemocha' ]);
- grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-simple-mocha');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-release');
};
View
5 package.json
@@ -10,7 +10,7 @@
},
"main": "lib/index.js",
"scripts": {
- "test": "mocha test"
+ "test": "grunt test"
},
"engines": {
"node": "~0.10"
@@ -31,7 +31,8 @@
"mocha": "1.8.1",
"grunt": "~ 0.4.0",
"grunt-contrib-jshint": ">= 0.1.1",
- "grunt-release": "~0.5.1"
+ "grunt-release": "~0.5.1",
+ "grunt-simple-mocha": "~0.4.0"
},
"dependencies": {
"glob-whatev": "0.1.8",
View
2  test/test.js
@@ -39,7 +39,7 @@ var expected = {
}
};
-expected['latest'] = expected['2.0.0'];
+expected.latest = expected['2.0.0'];
var normalizer = function (filename) {
return path.relative(__dirname, filename);
Please sign in to comment.
Something went wrong with that request. Please try again.