From 0c3934838e2798478ca502b2b0a275f1f0cb4a66 Mon Sep 17 00:00:00 2001 From: Brian Detering Date: Sat, 19 Apr 2014 21:17:57 -0700 Subject: [PATCH] added grunt test on watch --- gruntfile.js | 20 ++++++++++++++++++++ package.json | 5 ++++- test.js | 1 - 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 gruntfile.js diff --git a/gruntfile.js b/gruntfile.js new file mode 100644 index 0000000..db29b37 --- /dev/null +++ b/gruntfile.js @@ -0,0 +1,20 @@ +module.exports = function(grunt) { + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + + nodeunit: { + all: ['test.js'] + }, + + watch: { + scripts: { + files: ['**/*'], + tasks: ['nodeunit'] + } + } + }); + + grunt.loadNpmTasks('grunt-contrib-nodeunit'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.registerTask('default', ['nodeunit']); +}; diff --git a/package.json b/package.json index f8fed18..9202fb6 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,10 @@ }, "devDependencies": { "mysql": "~2.1.1", - "sqlite3": "~2.1.15" + "sqlite3": "~2.1.15", + "grunt": "~0.4.4", + "grunt-contrib-nodeunit": "~0.3.3", + "grunt-contrib-watch": "~0.6.1" }, "scripts": { "test": "nodeunit test.js" diff --git a/test.js b/test.js index b8b2e24..207c854 100644 --- a/test.js +++ b/test.js @@ -65,7 +65,6 @@ var createTests = function (fig) { this.sql.query( 'SeLECT * FROM TableA', function (err, rows) { - console.log(err); test.deepEqual(rows, [{ id: 2, col: "default"}]); test.done(); }