From 2664cfe7b6507cbfa98354df93af614d36b3183b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= Date: Fri, 5 Dec 2014 12:56:23 +0100 Subject: [PATCH] Prepare for travis ci testing --- .travis.yml | 3 +++ Gruntfile.js | 19 +++++++++++++++++-- package.json | 4 ++-- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7d49252 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,3 @@ +"scripts": { + "test": "grunt travis --verbose" +} \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index b5ada74..5392ddc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -33,14 +33,29 @@ module.exports = function(grunt) { preserveLicenseComments: false } } + }, + jshint: { + // define the files to lint + files: ['gruntfile.js', 'src/**/*.js', 'test/**/*.js'], + // configure JSHint (documented at http://www.jshint.com/docs/) + options: { + // more options here if you want to override JSHint defaults + globals: { + jQuery: true, + console: true, + module: true + } + } } }); // grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-requirejs'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + + grunt.registerTask('travis', ['requirejs', 'jshint']); + grunt.registerTask('default', ['requirejs', 'jshint']); - // Default task(s). - grunt.registerTask('default', ['requirejs']); }; \ No newline at end of file diff --git a/package.json b/package.json index 4ff71e1..5c43cc3 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "OAuth 2.0 implementation in Javascript", "main": "src/jso.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "grunt travis --verbose" }, "repository": { "type": "git", @@ -21,7 +21,7 @@ ], "devDependencies": { "grunt": "~0.4.5", - "grunt-contrib-jshint": "~0.10.0", + "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-nodeunit": "~0.4.1", "grunt-requirejs": "*" },