Ensure reEvaluateDelimiter is assigned an initial value if evaluateDelimiter is undefined by default. [closes #52]

Former-commit-id: 6cefeeca164901e611009ce1413e5080027592c9
This commit is contained in:
John-David Dalton
2012-07-18 01:53:15 -04:00
parent 5f5806a98e
commit 1c8cd8c168
3 changed files with 35 additions and 23 deletions

View File

@@ -77,6 +77,16 @@
QUnit.module('lodash');
(function() {
// ensure this test is executed before any other template tests to avoid false positives
test('should initialize `reEvaluateDelimiter` correctly (test with production build)', function() {
var data = { 'a': [1, 2] },
settings = _.templateSettings;
_.templateSettings = { 'interpolate': /\{\{(.+?)\}\}/g };
equal(_.template('{{ a.join(",") }}', data), '1,2');
_.templateSettings = settings;
});
test('supports loading lodash.js as the "lodash" module', function() {
if (window.document && window.require) {
equal((lodashModule || {}).moduleName, 'lodash');