QUnit: test minified files

Fixes #32574.


git-svn-id: https://develop.svn.wordpress.org/trunk@32698 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ella Iseulde Van Dorpe 2015-06-06 19:57:54 +00:00
parent cb73a0cc1a
commit 66f327cff2

View File

@ -118,9 +118,10 @@ module.exports = function(grunt) {
dest: 'tests/qunit/compiled.html',
options: {
processContent: function( src ) {
src = src.replace( /([^\.])*\.\.\/src/ig , '/../build' );
src = src.replace( '/jquery/ui/core.js', '/jquery/ui/core.min.js' );
return src;
return src.replace( /(\".+?\/)src(\/.+?)(?:.min)?(.js\")/g , function( match, $1, $2, $3 ) {
// Don't add `.min` to files that don't have it.
return $1 + 'build' + $2 + ( /jquery$/.test( $2 ) ? '' : '.min' ) + $3;
} );
}
}
}