Fix amd test fails.

This commit is contained in:
John-David Dalton
2016-10-15 12:14:57 -07:00
parent 4af0c066ec
commit c82322c490
2 changed files with 35 additions and 32 deletions

View File

@@ -40,36 +40,38 @@
var lodash = _.noConflict(); var lodash = _.noConflict();
return function(_) { return function(_) {
lodash.defaultsDeep(_, { 'templateSettings': lodash.templateSettings }); lodash(_)
lodash.mixin(_, lodash.pick(lodash, lodash.difference([ .defaultsDeep({ 'templateSettings': lodash.templateSettings })
'countBy', .mixin(lodash.pick(lodash, lodash.difference([
'debounce', 'countBy',
'difference', 'debounce',
'find', 'difference',
'findIndex', 'find',
'findLastIndex', 'findIndex',
'groupBy', 'findLastIndex',
'includes', 'groupBy',
'invert', 'includes',
'invokeMap', 'invert',
'keyBy', 'invokeMap',
'omit', 'keyBy',
'partition', 'omit',
'reduceRight', 'partition',
'reject', 'reduceRight',
'sample', 'reject',
'without' 'sample',
], lodash.functions(_)))); 'without'
], lodash.functions(_))))
.value();
lodash.forOwn(keyMap, function(realName, otherName) { lodash.forOwn(keyMap, function(realName, otherName) {
_[otherName] = lodash[realName]; _[otherName] = lodash[realName];
_.prototype[otherName] = lodash.prototype[realName]; _.prototype[otherName] = lodash.prototype[realName];
}); });
lodash.forOwn(aliasToReal, function(realName, alias) { lodash.forOwn(aliasToReal, function(realName, alias) {
_[alias] = _[realName]; _[alias] = _[realName];
_.prototype[alias] = _.prototype[realName]; _.prototype[alias] = _.prototype[realName];
}); });
return _;
}; };
}()); }());
@@ -147,7 +149,7 @@
QUnit.config.autostart = false; QUnit.config.autostart = false;
require(getConfig(), ['underscore'], function(lodash) { require(getConfig(), ['underscore'], function(lodash) {
mixinPrereqs(lodash); _ = mixinPrereqs(lodash);
require(getConfig(), ['backbone'], function() { require(getConfig(), ['backbone'], function() {
require(getConfig(), [ require(getConfig(), [
'test/setup/dom-setup', 'test/setup/dom-setup',
@@ -159,9 +161,7 @@
'test/router', 'test/router',
'test/view', 'test/view',
'test/sync' 'test/sync'
], function() { ], QUnit.start);
QUnit.start();
});
}); });
}); });
}()); }());

View File

@@ -352,18 +352,20 @@
var lodash = _.noConflict(); var lodash = _.noConflict();
return function(_) { return function(_) {
lodash.defaultsDeep(_, { 'templateSettings': lodash.templateSettings }); lodash(_)
lodash.mixin(_, lodash.pick(lodash, lodash.difference(lodash.functions(lodash), lodash.functions(_)))); .defaultsDeep({ 'templateSettings': lodash.templateSettings })
.mixin(lodash.pick(lodash, lodash.difference(lodash.functions(lodash), lodash.functions(_))))
.value();
lodash.forOwn(keyMap, function(realName, otherName) { lodash.forOwn(keyMap, function(realName, otherName) {
_[otherName] = lodash[realName]; _[otherName] = lodash[realName];
_.prototype[otherName] = lodash.prototype[realName]; _.prototype[otherName] = lodash.prototype[realName];
}); });
lodash.forOwn(aliasToReal, function(realName, alias) { lodash.forOwn(aliasToReal, function(realName, alias) {
_[alias] = _[realName]; _[alias] = _[realName];
_.prototype[alias] = _.prototype[realName]; _.prototype[alias] = _.prototype[realName];
}); });
return _;
}; };
}()); }());
@@ -445,9 +447,12 @@
} }
QUnit.config.autostart = false; QUnit.config.autostart = false;
QUnit.config.excused.Functions.iteratee = true;
QUnit.config.excused.Utility.noConflict = true;
QUnit.config.excused.Utility['noConflict (node vm)'] = true;
require(getConfig(), [moduleId], function(lodash) { require(getConfig(), [moduleId], function(lodash) {
mixinPrereqs(lodash); _ = mixinPrereqs(lodash);
require(getConfig(), [ require(getConfig(), [
'test/collections', 'test/collections',
'test/arrays', 'test/arrays',
@@ -456,9 +461,7 @@
'test/cross-document', 'test/cross-document',
'test/utility', 'test/utility',
'test/chaining' 'test/chaining'
], function() { ], QUnit.start);
QUnit.start();
});
}); });
}()); }());
</script> </script>