Skip to content

Commit bb128fe

Browse files
committed
Fix test assertions for validation test when using custom TypeInfo
- Test should had broke for changes in #355 which improved validation messages with suggestions. - But `expect().to.deep.equal()` checks for the right number of errors but does not check for equality of error messages.
1 parent 359ec76 commit bb128fe

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/validation/__tests__/validation-test.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,15 @@ describe('Validate: Supports full validation', () => {
6464
specifiedRules
6565
);
6666

67-
expect(errors).to.deep.equal([
68-
new Error('Cannot query field "catOrDog" on type "QueryRoot".'),
69-
new Error('Cannot query field "furColor" on type "Cat".'),
70-
new Error('Cannot query field "isHousetrained" on type "Dog".'),
67+
const errorMessages = errors.map(err => err.message);
68+
69+
expect(errorMessages).to.deep.equal([
70+
'Cannot query field "catOrDog" on type "QueryRoot". ' +
71+
'Did you mean "catOrDog"?',
72+
'Cannot query field "furColor" on type "Cat". ' +
73+
'Did you mean "furColor"?',
74+
'Cannot query field "isHousetrained" on type "Dog". ' +
75+
'Did you mean "isHousetrained"?'
7176
]);
7277
});
7378

0 commit comments

Comments
 (0)