Skip to content

Commit

Permalink
deepCopy each doc, so tests that use fixtures multiple times do not u…
Browse files Browse the repository at this point in the history
…se the same ids generated per doc by the first test
  • Loading branch information
bnoguchi committed Jun 25, 2013
1 parent 881ff35 commit 17e8ea7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -5,6 +5,7 @@ var debug = require('debug')('fixtures')
, deepEqual = objectUtils.deepEqual
, assign = objectUtils.assign
, Promise = require('./Promise')
, deepCopy = require('racer-util/object').deepCopy
;

module.exports = {
Expand Down Expand Up @@ -39,7 +40,7 @@ function loadFixtures (fixtures, store, cb, altNsTargets) {
var docs = fixtures[currNs];
promisesByNs[currNs] = promisesByNs[currNs] || {};
for (var currAlias in docs) {
var doc = docs[currAlias];
var doc = deepCopy(docs[currAlias]);
promisesByNs[currNs][currAlias] = promisesByNs[currNs][currAlias] || new Promise;
var deps = [];
var ignore = ['id'];
Expand Down

0 comments on commit 17e8ea7

Please sign in to comment.