Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
grunt-monty-python
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
fb3ecf8c
authored
2016-05-24 14:18:29 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Always set the requirejs callback, and pass withCoverage into the
builder.
1 parent
bb5a3b52
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
grunt-monty-python.js
grunt-monty-python.js
View file @
fb3ecf8
...
...
@@ -421,11 +421,10 @@ module.exports = function (grunt) {
};
})(
template
.
process
),
});
if
(
mpConfig
.
jasmine
.
withCoverage
)
{
var
instrumentationCallback
=
function
instrumentationCallback
(
mpConfigBase
)
{
var
requireCallback
=
function
requireCallback
(
mpConfigBase
,
withCoverage
)
{
/* global requirejs:false */
var
oldLoad
=
requirejs
.
load
;
re
quirejs
.
load
=
function
(
context
,
moduleName
,
url
)
{
requirejs
.
load
=
(
function
(
oldLoad
)
{
re
turn
function
(
context
,
moduleName
,
url
)
{
//console.log('context=' + JSON.stringify(arguments), 'moduleName=' + moduleName, 'url=' + url);
var
parts
=
url
.
split
(
'/'
);
for
(
var
i
=
0
;
i
<
parts
.
length
;
)
{
...
...
@@ -446,18 +445,20 @@ module.exports = function (grunt) {
}
}
url
=
parts
.
join
(
'/'
);
if
(
url
.
indexOf
(
mpConfigBase
+
'/scripts/'
)
===
0
)
{
if
(
withCoverage
&&
url
.
indexOf
(
mpConfigBase
+
'/scripts/'
)
===
0
)
{
url
=
'./.grunt/grunt-contrib-jasmine/'
+
url
;
}
return
oldLoad
.
apply
(
this
,
[
context
,
moduleName
,
url
]);
};
})(
requirejs
.
load
);
};
var
stringify
=
require
(
'node-stringify'
);
//templateOptions.requireConfig.callback = eval('(' + stringify(callbackBuilder) + ')(' + JSON.stringify(mpConfig.base) + ')');
/*jshint -W054*/
templateOptions
.
requireConfig
.
callback
=
new
Function
(
stringify
(
instrumentationCallback
)
+
'('
+
JSON
.
stringify
(
mpConfig
.
base
)
+
');'
);
templateOptions
.
requireConfig
.
callback
=
new
Function
(
stringify
(
requireCallback
)
+
'('
+
JSON
.
stringify
(
mpConfig
.
base
)
+
', '
+
mpConfig
.
jasmine
.
withCoverage
+
');'
);
if
(
mpConfig
.
jasmine
.
withCoverage
)
{
templateOptions
=
{
coverage
:
'dist/coverage/coverage.json'
,
report
:
'dist/coverage'
,
...
...
Please
register
or
sign in
to post a comment