From 00dffd1bf881448f22202b21da7f5023abb75182 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 9 Nov 2013 20:43:58 +0000 Subject: [PATCH] Add `grunt qunit:compiled` to run the QUnit tests on the compiled JS. props jorbin, kadamwhite. fixes #25781. git-svn-id: https://develop.svn.wordpress.org/trunk@26063 602fd350-edb4-49c9-b593-d223f7449a82 --- Gruntfile.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index e20cf46738..4bfe5c3dc7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -23,7 +23,8 @@ module.exports = function(grunt) { BUILD_DIR + 'wp-includes/js/tinymce/wp-tinymce-schema.min.js', BUILD_DIR + 'wp-includes/js/tinymce/mark_loaded.js' ] - } + }, + qunit: ['tests/qunit/compiled.html'] }, copy: { files: { @@ -64,6 +65,15 @@ module.exports = function(grunt) { cwd: SOURCE_DIR, dest: BUILD_DIR, src: [] + }, + 'qunit-compiled': { + src: 'tests/qunit/index.html', + dest: 'tests/qunit/compiled.html', + options: { + processContent: function( src ) { + return src.replace( /([^\.])*\.\.\/src/ig , '/../build' ); + } + } } }, cssmin: { @@ -249,8 +259,9 @@ module.exports = function(grunt) { grunt.registerTask('build', ['clean:all', 'copy:all', 'cssmin:core', 'uglify:core', 'uglify:tinymce', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']); - // Testing task. + // Testing tasks. grunt.registerTask('test', ['qunit']); + grunt.registerTask('test:compiled', ['build', 'clean:qunit', 'copy:qunit-compiled', 'qunit']); // Default task. grunt.registerTask('default', ['build']);