Loosen up regex for detecting amd callback

Previous to this change if the callback only contained
'$' or '_' as variables to hold the required dependency,
it was not detected and qunit was not injected properly

fixes CNVS-29207

Test Plan:
  - Automated tests pass that contain only $
  - Normal automated tests pass

Change-Id: I22d9cb390bfc1f0b579577dc7bec2de40fd5dc3f
Reviewed-on: https://gerrit.instructure.com/79017
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
This commit is contained in:
Clay Diffrient 2016-05-06 15:47:40 -06:00
parent 7db2f23b53
commit 4655dc941d
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ module.exports = function(source){
});
// add a qunit reference in the AMD callback to capture the qunit dependency
newSource = newSource.replace(/define[\s\S]*\],\s*\(.*[a-zA-Z].*\)\s*=>/, function(match){
newSource = newSource.replace(/define[\s\S]*\],\s*\(.*\)\s*=>/, function(match){
return match.replace(/\],\s*\(/, function(innerMatch){
return innerMatch + "qunit,";
});