mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-14 04:37:50 +00:00
Cleanup test/test-build.js.
Former-commit-id: 4edb24bf22b8e8f9aa45b08a97289c1b83461e16
This commit is contained in:
@@ -489,11 +489,10 @@
|
|||||||
|
|
||||||
context._ = _;
|
context._ = _;
|
||||||
vm.runInContext(source, context);
|
vm.runInContext(source, context);
|
||||||
var templates = context._.templates;
|
|
||||||
|
|
||||||
equal(templates.a(data.a).replace(/[\r\n]+/g, ''), '<ul><li>moe</li><li>larry</li><li>curly</li></ul>', basename);
|
equal(_.templates.a(data.a).replace(/[\r\n]+/g, ''), '<ul><li>moe</li><li>larry</li><li>curly</li></ul>', basename);
|
||||||
equal(templates.b(data.b), 'Hello stooge.', basename);
|
equal(_.templates.b(data.b), 'Hello stooge.', basename);
|
||||||
equal(templates.c(data.c), 'Hello ES6!', basename);
|
equal(_.templates.c(data.c), 'Hello ES6!', basename);
|
||||||
delete _.templates;
|
delete _.templates;
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
@@ -506,21 +505,18 @@
|
|||||||
build(['-s', 'template=' + templatePath + '/*.jst', 'exports=amd'].concat(command || []), function(source, filePath) {
|
build(['-s', 'template=' + templatePath + '/*.jst', 'exports=amd'].concat(command || []), function(source, filePath) {
|
||||||
var moduleId,
|
var moduleId,
|
||||||
basename = path.basename(filePath, '.js'),
|
basename = path.basename(filePath, '.js'),
|
||||||
context = createContext(),
|
context = createContext();
|
||||||
pass = false;
|
|
||||||
|
|
||||||
(context.define = function(requires, factory) {
|
context.define = function(requires, factory) {
|
||||||
factory(_);
|
factory(_);
|
||||||
var templates = _.templates;
|
moduleId = requires[0];
|
||||||
moduleId = requires + '';
|
};
|
||||||
pass = 'a' in templates && 'b' in templates;
|
|
||||||
})
|
|
||||||
.amd = {};
|
|
||||||
|
|
||||||
|
context.define.amd = {};
|
||||||
vm.runInContext(source, context);
|
vm.runInContext(source, context);
|
||||||
|
|
||||||
equal(moduleId, command ? 'underscore' : 'lodash');
|
equal(moduleId, (command ? 'underscore' : 'lodash'), basename);
|
||||||
ok(pass, basename);
|
ok('a' in _.templates && 'b' in _.templates, basename);
|
||||||
delete _.templates;
|
delete _.templates;
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
@@ -530,7 +526,7 @@
|
|||||||
var start = _.after(2, _.once(QUnit.start));
|
var start = _.after(2, _.once(QUnit.start));
|
||||||
|
|
||||||
build(['-s', 'template=' + templatePath + '/*.tpl', 'settings={interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/}'].concat(command || []), function(source, filePath) {
|
build(['-s', 'template=' + templatePath + '/*.tpl', 'settings={interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/}'].concat(command || []), function(source, filePath) {
|
||||||
var moduleId, templates,
|
var moduleId,
|
||||||
basename = path.basename(filePath, '.js'),
|
basename = path.basename(filePath, '.js'),
|
||||||
context = createContext();
|
context = createContext();
|
||||||
|
|
||||||
@@ -538,20 +534,16 @@
|
|||||||
'd': { 'name': 'Mustache' }
|
'd': { 'name': 'Mustache' }
|
||||||
};
|
};
|
||||||
|
|
||||||
(context.define = function(requires, factory) {
|
context.define = function(requires, factory) {
|
||||||
factory(_);
|
factory(_);
|
||||||
templates = _.templates;
|
moduleId = requires[0];
|
||||||
moduleId = requires + '';
|
};
|
||||||
})
|
|
||||||
.amd = {};
|
|
||||||
|
|
||||||
context._ = _;
|
context.define.amd = {};
|
||||||
vm.runInContext(source, context);
|
vm.runInContext(source, context);
|
||||||
|
|
||||||
var templates = context._.templates;
|
equal(moduleId, (command ? 'underscore' : 'lodash'), basename);
|
||||||
|
equal(_.templates.d(data.d), 'Hello Mustache!', basename);
|
||||||
equal(moduleId, command ? 'underscore' : 'lodash');
|
|
||||||
equal(templates.d(data.d), 'Hello Mustache!', basename);
|
|
||||||
delete _.templates;
|
delete _.templates;
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user