Skip to content

Commit

Permalink
🐛 compensates for an intermittent fixtures bug
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnath committed Jul 11, 2017
1 parent c3d15a9 commit 39a46b9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,18 @@ test.serial('Utils: Format Results - with follow', t => {
});

test.serial('Utils: Format Results - depth with follow', t => {
const testable = utils.testables(live, allTypes);
let testable = utils.testables(live, allTypes);
const query = {
follow: 'true',
depth: 2, // depth gets subtracted during attributes, to see depth the format function needs at least depth: two
};

// fixes a bug where sometimes testable.model.attributes is null
if (!testable.model || !testable.model.attributes) {
const refixtures = utils.generate(generated, lang);
testable = utils.testables(refixtures.live, refixtures.types.full);
}

const formatted = apiUtils.format([testable.expected], testable.model.attributes, allTypes, query);

return formatted.then(result => {
Expand Down

0 comments on commit 39a46b9

Please sign in to comment.