mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Fix failing tests for rhino -require.
This commit is contained in:
16
test/test.js
16
test/test.js
@@ -524,13 +524,13 @@
|
||||
var bound = _.bind(func, null),
|
||||
actual = bound('a');
|
||||
|
||||
ok(actual[0] === null || actual[0] === root);
|
||||
ok(actual[0] === null || actual[0] && actual[0].Array);
|
||||
equal(actual[1], 'a');
|
||||
|
||||
bound = _.bind(func, undefined);
|
||||
actual = bound('b');
|
||||
|
||||
ok(actual[0] === undefined || actual[0] === root);
|
||||
ok(actual[0] === undefined || actual[0] && actual[0].Array);
|
||||
equal(actual[1], 'b');
|
||||
});
|
||||
|
||||
@@ -6008,33 +6008,33 @@
|
||||
test('should work with custom `_.templateSettings` delimiters', 1, function() {
|
||||
var settings = _.clone(_.templateSettings);
|
||||
|
||||
_.templateSettings = {
|
||||
_.assign(_.templateSettings, {
|
||||
'escape': /\{\{-([\s\S]+?)\}\}/g,
|
||||
'evaluate': /\{\{([\s\S]+?)\}\}/g,
|
||||
'interpolate': /\{\{=([\s\S]+?)\}\}/g
|
||||
};
|
||||
});
|
||||
|
||||
var compiled = _.template('<ul>{{ _.each(collection, function(value, index) { }}<li>{{= index }}: {{- value }}</li>{{ }); }}</ul>'),
|
||||
expected = '<ul><li>0: a & A</li><li>1: b & B</li></ul>';
|
||||
|
||||
equal(compiled({ 'collection': ['a & A', 'b & B'] }), expected);
|
||||
_.extend(_.templateSettings, settings);
|
||||
_.assign(_.templateSettings, settings);
|
||||
});
|
||||
|
||||
test('should work with `_.templateSettings` delimiters containing special characters', 1, function() {
|
||||
var settings = _.clone(_.templateSettings);
|
||||
|
||||
_.templateSettings = {
|
||||
_.assign(_.templateSettings, {
|
||||
'escape': /<\?-([\s\S]+?)\?>/g,
|
||||
'evaluate': /<\?([\s\S]+?)\?>/g,
|
||||
'interpolate': /<\?=([\s\S]+?)\?>/g
|
||||
};
|
||||
});
|
||||
|
||||
var compiled = _.template('<ul><? _.each(collection, function(value, index) { ?><li><?= index ?>: <?- value ?></li><? }); ?></ul>'),
|
||||
expected = '<ul><li>0: a & A</li><li>1: b & B</li></ul>';
|
||||
|
||||
equal(compiled({ 'collection': ['a & A', 'b & B'] }), expected);
|
||||
_.extend(_.templateSettings, settings);
|
||||
_.assign(_.templateSettings, settings);
|
||||
});
|
||||
|
||||
test('supports recursive calls', 1, function() {
|
||||
|
||||
21
vendor/qunit-clib/qunit-clib.js
vendored
21
vendor/qunit-clib/qunit-clib.js
vendored
@@ -173,26 +173,23 @@
|
||||
console.log(' Finished in ' + details.runtime + ' milliseconds.');
|
||||
console.log(hr);
|
||||
|
||||
var fails = details.failed,
|
||||
error = fails + ' of ' + details.total + ' tests failed.';
|
||||
|
||||
// exit out of Node.js or PhantomJS
|
||||
try {
|
||||
var process = context.process || context.phantom;
|
||||
if (fails) {
|
||||
console.error('Error: ' + error);
|
||||
if (details.failed) {
|
||||
process.exit(1);
|
||||
} else {
|
||||
process.exit(0);
|
||||
}
|
||||
} catch(e) {
|
||||
if (fails) {
|
||||
throw new Error(error);
|
||||
}
|
||||
}
|
||||
// exit out of Narhwal, Rhino, or RingoJS
|
||||
} catch(e) { }
|
||||
|
||||
// exit out of Narwhal, Rhino, or RingoJS
|
||||
try {
|
||||
quit();
|
||||
if (details.failed) {
|
||||
java.lang.System.exit(1);
|
||||
} else {
|
||||
quit();
|
||||
}
|
||||
} catch(e) { }
|
||||
};
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user