diff --git a/Gruntfile.js b/Gruntfile.js index 63c20bf..a683e8d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -33,6 +33,10 @@ module.exports = function(grunt) { } }, + nodeunit: { + all: ['test/unit/*.js'] + }, + webpack: generateWebpackConfig(), watch: { @@ -41,13 +45,13 @@ module.exports = function(grunt) { tasks: ['build'] }, test: { - files: ['lib/**/*.js', 'specs/**/*.js'], + files: ['lib/**/*.js', 'test/**/*.js'], tasks: ['test'] } } }); - grunt.registerTask('test', ['webpack:global', 'karma:single']); + grunt.registerTask('test', ['webpack:global', 'nodeunit', 'karma:single']); grunt.registerTask('build', ['webpack']); grunt.registerTask('publish', ['clean', 'test', 'build', 'update_json']); diff --git a/karma.conf.js b/karma.conf.js index a85a85e..8e7f033 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -16,7 +16,7 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ 'dist/axios.js', - 'specs/axios.spec.js' + 'test/specs/axios.spec.js' ], diff --git a/package.json b/package.json index 039abce..8e5f08e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "Lightweight Promise based XHR library", "main": "index.js", "scripts": { - "test": "grunt test" + "test": "grunt test", + "start": "node ./sandbox/index.js" }, "repository": { "type": "git", @@ -38,6 +39,7 @@ "grunt-karma": "^0.8.3", "karma-phantomjs-launcher": "^0.1.4", "karma-jasmine-ajax": "^0.1.4", - "grunt-update-json": "^0.1.3" + "grunt-update-json": "^0.1.3", + "grunt-contrib-nodeunit": "^0.4.1" } } diff --git a/specs/axios.spec.js b/test/specs/axios.spec.js similarity index 100% rename from specs/axios.spec.js rename to test/specs/axios.spec.js