Tweak expected output w/r/t lodash changes; add templateSetting.variable to test configs
This commit is contained in:
parent
44f5566772
commit
9f4671ed41
28
Gruntfile.js
28
Gruntfile.js
@ -31,12 +31,20 @@ module.exports = function(grunt) {
|
|||||||
// Configuration to be run (and then tested).
|
// Configuration to be run (and then tested).
|
||||||
jst: {
|
jst: {
|
||||||
compile: {
|
compile: {
|
||||||
|
options: {
|
||||||
|
templateSettings: {
|
||||||
|
variable: 'obj'
|
||||||
|
}
|
||||||
|
},
|
||||||
files: {
|
files: {
|
||||||
"tmp/jst.js": ["test/fixtures/template.html"]
|
"tmp/jst.js": ["test/fixtures/template.html"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pretty_amd: {
|
pretty_amd: {
|
||||||
options: {
|
options: {
|
||||||
|
templateSettings: {
|
||||||
|
variable: 'obj'
|
||||||
|
},
|
||||||
prettify: true,
|
prettify: true,
|
||||||
amdWrapper: true
|
amdWrapper: true
|
||||||
},
|
},
|
||||||
@ -46,6 +54,9 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
prettify: {
|
prettify: {
|
||||||
options: {
|
options: {
|
||||||
|
templateSettings: {
|
||||||
|
variable: 'obj'
|
||||||
|
},
|
||||||
prettify: true
|
prettify: true
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
@ -54,6 +65,9 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
amd_wrapper: {
|
amd_wrapper: {
|
||||||
options: {
|
options: {
|
||||||
|
templateSettings: {
|
||||||
|
variable: 'obj'
|
||||||
|
},
|
||||||
amdWrapper:true
|
amdWrapper:true
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
@ -61,12 +75,20 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
uglyfile: {
|
uglyfile: {
|
||||||
|
options: {
|
||||||
|
templateSettings: {
|
||||||
|
variable: 'obj'
|
||||||
|
},
|
||||||
|
},
|
||||||
files: {
|
files: {
|
||||||
"tmp/uglyfile.js": ["test/fixtures/*bad-filename*"]
|
"tmp/uglyfile.js": ["test/fixtures/*bad-filename*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ns_nested: {
|
ns_nested: {
|
||||||
options: {
|
options: {
|
||||||
|
templateSettings: {
|
||||||
|
variable: 'obj'
|
||||||
|
},
|
||||||
namespace: "MyApp.JST.Main"
|
namespace: "MyApp.JST.Main"
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
@ -75,6 +97,9 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
ns_nested_this: {
|
ns_nested_this: {
|
||||||
options: {
|
options: {
|
||||||
|
templateSettings: {
|
||||||
|
variable: 'obj'
|
||||||
|
},
|
||||||
namespace: "this.MyApp.JST.Main"
|
namespace: "this.MyApp.JST.Main"
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
@ -83,6 +108,9 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
process_content: {
|
process_content: {
|
||||||
options: {
|
options: {
|
||||||
|
templateSettings: {
|
||||||
|
variable: 'obj'
|
||||||
|
},
|
||||||
processContent: function (src) {
|
processContent: function (src) {
|
||||||
return src.replace(/(^\s+|\s+$)/gm, '');
|
return src.replace(/(^\s+|\s+$)/gm, '');
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,7 @@ define(function(){
|
|||||||
this["JST"] = this["JST"] || {};
|
this["JST"] = this["JST"] || {};
|
||||||
|
|
||||||
this["JST"]["test/fixtures/template.html"] = function(obj) {
|
this["JST"]["test/fixtures/template.html"] = function(obj) {
|
||||||
obj || (obj = {});
|
var __t, __p = '', __e = _.escape;
|
||||||
var __t, __p = '', __e = _.escape, __d = obj.obj || obj;
|
|
||||||
__p += '<head><title>' +
|
__p += '<head><title>' +
|
||||||
((__t = ( obj.title )) == null ? '' : __t) +
|
((__t = ( obj.title )) == null ? '' : __t) +
|
||||||
'</title></head>';
|
'</title></head>';
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
this["JST"] = this["JST"] || {};
|
this["JST"] = this["JST"] || {};
|
||||||
|
|
||||||
this["JST"]["test/fixtures/template.html"] = function(obj) {
|
this["JST"]["test/fixtures/template.html"] = function(obj) {
|
||||||
obj || (obj = {});
|
var __t, __p = '', __e = _.escape;
|
||||||
var __t, __p = '', __e = _.escape, __d = obj.obj || obj;
|
|
||||||
__p += '<head><title>' +
|
__p += '<head><title>' +
|
||||||
((__t = ( obj.title )) == null ? '' : __t) +
|
((__t = ( obj.title )) == null ? '' : __t) +
|
||||||
'</title></head>';
|
'</title></head>';
|
||||||
|
@ -3,8 +3,7 @@ this["MyApp"]["JST"] = this["MyApp"]["JST"] || {};
|
|||||||
this["MyApp"]["JST"]["Main"] = this["MyApp"]["JST"]["Main"] || {};
|
this["MyApp"]["JST"]["Main"] = this["MyApp"]["JST"]["Main"] || {};
|
||||||
|
|
||||||
this["MyApp"]["JST"]["Main"]["test/fixtures/template.html"] = function(obj) {
|
this["MyApp"]["JST"]["Main"]["test/fixtures/template.html"] = function(obj) {
|
||||||
obj || (obj = {});
|
var __t, __p = '', __e = _.escape;
|
||||||
var __t, __p = '', __e = _.escape, __d = obj.obj || obj;
|
|
||||||
__p += '<head><title>' +
|
__p += '<head><title>' +
|
||||||
((__t = ( obj.title )) == null ? '' : __t) +
|
((__t = ( obj.title )) == null ? '' : __t) +
|
||||||
'</title></head>';
|
'</title></head>';
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
this["JST"] = this["JST"] || {};
|
this["JST"] = this["JST"] || {};
|
||||||
|
|
||||||
this["JST"]["test/fixtures/template.html"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape, __d = obj.obj || obj;__p += '<head><title>' +((__t = ( obj.title )) == null ? '' : __t) +'</title></head>';return __p};
|
this["JST"]["test/fixtures/template.html"] = function(obj) {var __t, __p = '', __e = _.escape;__p += '<head><title>' +((__t = ( obj.title )) == null ? '' : __t) +'</title></head>';return __p};
|
@ -2,7 +2,7 @@ define(function(){
|
|||||||
|
|
||||||
this["JST"] = this["JST"] || {};
|
this["JST"] = this["JST"] || {};
|
||||||
|
|
||||||
this["JST"]["test/fixtures/template.html"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape, __d = obj.obj || obj;__p += '<head><title>' +((__t = ( obj.title )) == null ? '' : __t) +'</title></head>';return __p};
|
this["JST"]["test/fixtures/template.html"] = function(obj) {var __t, __p = '', __e = _.escape;__p += '<head><title>' +((__t = ( obj.title )) == null ? '' : __t) +'</title></head>';return __p};
|
||||||
|
|
||||||
return this["JST"];
|
return this["JST"];
|
||||||
});
|
});
|
@ -1,8 +1,7 @@
|
|||||||
this["JST"] = this["JST"] || {};
|
this["JST"] = this["JST"] || {};
|
||||||
|
|
||||||
this["JST"]["test/fixtures/indent_template.html"] = function(obj) {
|
this["JST"]["test/fixtures/indent_template.html"] = function(obj) {
|
||||||
obj || (obj = {});
|
var __t, __p = '', __e = _.escape;
|
||||||
var __t, __p = '', __e = _.escape, __d = obj.obj || obj;
|
|
||||||
__p += '<div>\n<div>\n<div>\n' +
|
__p += '<div>\n<div>\n<div>\n' +
|
||||||
((__t = ( obj.name )) == null ? '' : __t) +
|
((__t = ( obj.name )) == null ? '' : __t) +
|
||||||
'\n</div>\n</div>\n</div>';
|
'\n</div>\n</div>\n</div>';
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
this["JST"] = this["JST"] || {};
|
this["JST"] = this["JST"] || {};
|
||||||
|
|
||||||
this["JST"]["test/fixtures/it's-a-bad-filename.html"] = function(obj) {
|
this["JST"]["test/fixtures/it's-a-bad-filename.html"] = function(obj) {
|
||||||
obj || (obj = {});
|
var __t, __p = '', __e = _.escape;
|
||||||
var __t, __p = '', __e = _.escape, __d = obj.obj || obj;
|
|
||||||
__p += 'never name your file like this.';
|
__p += 'never name your file like this.';
|
||||||
return __p
|
return __p
|
||||||
};
|
};
|
2
test/fixtures/indent_template.html
vendored
2
test/fixtures/indent_template.html
vendored
@ -1,7 +1,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<%= name %>
|
<%= obj.name %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
2
test/fixtures/template.html
vendored
2
test/fixtures/template.html
vendored
@ -1 +1 @@
|
|||||||
<head><title><%= title %></title></head>
|
<head><title><%= obj.title %></title></head>
|
Loading…
Reference in New Issue
Block a user