grunt-contrib-jasmine
withを使用しgrunt-template-jasmine-requirejs
てテンプレートを生成しています。Node v0.12.14 では問題なく動作していましたが、Node v4.5.0 にアップグレードすると、specrunner ファイルの出力が正しくありません。HTML だけでなく、出力にも JavaScript のチャンクが含まれています。チャンクの例:
function (obj) {
obj || (obj = {});
var __t, __p = '', __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
with (obj) {
__p += '<!doctype html>\n<html>\n<head>\n <meta charset="utf-8">\n <title>Jasmine Spec Runner</title>\n\n ';
css.forEach(function(style){ ;
__p += '\n <link rel="stylesheet" type="text/css" href="' +
((__t = ( style )) == null ? '' : __t) +
'">\n ';
}) ;
__p += '\n\n ';
with (scripts) { ;
__p += '\n ';
[].concat(vendor).forEach(function(script){ ;
__p += '\n <script src="' +
((__t = ( script )) == null ? '' : __t) +
'"></script>\n ';
これが私の Gruntfile の「jasmine」セクションです。
jasmine: {
test: {
options: {
vendor: ["src/libs/jquery.js"],
display: "short",
summary: true,
specs: ['test/test.js'],
styles: ['src/css/main.css'],
template: require('grunt-template-jasmine-requirejs'),
templateOptions: {
requireConfig: {
baseUrl: 'src/',
paths: {
"test": "../test",
"jquery-1.9": "jquery-1.9.1"
}
}
}
}
}
}
私が気付いていない「grunt-template-jasmine-requirejs」の「templateOptions」が変更されましたか? 私が使用しているバージョンは次のとおりです。
grunt-template-jasmine-requirejs 0.2.3
grunt-contrib-requirejs 1.0.0
grunt-contrib-jasmine 1.0.3