From 381affa4e42d5e0d834e0432fd1815ec90cfa335 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 30 Aug 2013 04:06:34 +0000 Subject: [PATCH] Add `grunt test` task for QUnit tests. props kadamwhite. see #25096. git-svn-id: https://develop.svn.wordpress.org/trunk@25178 602fd350-edb4-49c9-b593-d223f7449a82 --- Gruntfile.js | 11 +++++++++++ package.json | 1 + 2 files changed, 12 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index deecaa6908..9ad99a303a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -53,6 +53,9 @@ module.exports = function(grunt) { ] } }, + qunit: { + files: ['tests/qunit/**/*.html'] + }, uglify: { core: { expand: true, @@ -104,6 +107,10 @@ module.exports = function(grunt) { spawn: false, interval: 2000 } + }, + test: { + files: ['tests/qunit/**'], + tasks: ['qunit'] } } }); @@ -112,6 +119,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-cssmin'); + grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); @@ -119,6 +127,9 @@ module.exports = function(grunt) { grunt.registerTask('build', ['clean:all', 'copy:all', 'cssmin:core', 'uglify:core', 'uglify:tinymce']); + // Testing task. + grunt.registerTask('test', ['qunit']); + // Default task. grunt.registerTask('default', ['build']); diff --git a/package.json b/package.json index b12e46f04f..b733be8214 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "grunt-contrib-clean": "~0.5.0", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-cssmin": "~0.6.1", + "grunt-contrib-qunit": "~0.2.2", "grunt-contrib-uglify": "~0.2.2", "grunt-contrib-watch": "~0.5.1" }