From 66f327cff2d6708e4e29bf343dd87bf218c0b05c Mon Sep 17 00:00:00 2001 From: Ella Iseulde Van Dorpe Date: Sat, 6 Jun 2015 19:57:54 +0000 Subject: [PATCH] QUnit: test minified files Fixes #32574. git-svn-id: https://develop.svn.wordpress.org/trunk@32698 602fd350-edb4-49c9-b593-d223f7449a82 --- Gruntfile.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 51027afd93..b419d497ff 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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; + } ); } } }