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
This commit is contained in:
parent
4d3e26f321
commit
00dffd1bf8
15
Gruntfile.js
15
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/wp-tinymce-schema.min.js',
|
||||||
BUILD_DIR + 'wp-includes/js/tinymce/mark_loaded.js'
|
BUILD_DIR + 'wp-includes/js/tinymce/mark_loaded.js'
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
qunit: ['tests/qunit/compiled.html']
|
||||||
},
|
},
|
||||||
copy: {
|
copy: {
|
||||||
files: {
|
files: {
|
||||||
@ -64,6 +65,15 @@ module.exports = function(grunt) {
|
|||||||
cwd: SOURCE_DIR,
|
cwd: SOURCE_DIR,
|
||||||
dest: BUILD_DIR,
|
dest: BUILD_DIR,
|
||||||
src: []
|
src: []
|
||||||
|
},
|
||||||
|
'qunit-compiled': {
|
||||||
|
src: 'tests/qunit/index.html',
|
||||||
|
dest: 'tests/qunit/compiled.html',
|
||||||
|
options: {
|
||||||
|
processContent: function( src ) {
|
||||||
|
return src.replace( /([^\.])*\.\.\/src/ig , '/../build' );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cssmin: {
|
cssmin: {
|
||||||
@ -249,8 +259,9 @@ module.exports = function(grunt) {
|
|||||||
grunt.registerTask('build', ['clean:all', 'copy:all', 'cssmin:core', 'uglify:core',
|
grunt.registerTask('build', ['clean:all', 'copy:all', 'cssmin:core', 'uglify:core',
|
||||||
'uglify:tinymce', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']);
|
'uglify:tinymce', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']);
|
||||||
|
|
||||||
// Testing task.
|
// Testing tasks.
|
||||||
grunt.registerTask('test', ['qunit']);
|
grunt.registerTask('test', ['qunit']);
|
||||||
|
grunt.registerTask('test:compiled', ['build', 'clean:qunit', 'copy:qunit-compiled', 'qunit']);
|
||||||
|
|
||||||
// Default task.
|
// Default task.
|
||||||
grunt.registerTask('default', ['build']);
|
grunt.registerTask('default', ['build']);
|
||||||
|
Loading…
Reference in New Issue
Block a user