Skip to content

Commit

Permalink
Check for errors in matchFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie committed Jul 14, 2020
1 parent e63b9f2 commit b1e08d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silent-onions-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/test-utils': patch
---

Improved error reporting in `matchFilter`.
3 changes: 2 additions & 1 deletion packages/test-utils/lib/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ const matchFilter = ({ keystone, queryArgs, fieldSelection, expected, sortKey })
query: `query {
allTests${queryArgs ? `(${queryArgs})` : ''} { ${fieldSelection} }
}`,
}).then(({ data }) => {
}).then(({ data, errors }) => {
expect(errors).toBe(undefined);
const value = sortKey ? sorted(data.allTests || [], i => i[sortKey]) : data.allTests;
expect(value).toEqual(expected);
});
Expand Down

0 comments on commit b1e08d8

Please sign in to comment.