You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pattern as used in /lib/testUtils.js. However, this is not only really ugly, but it also lacks proper validation error messages. If the test fails, the only thing the reporter knows is that the spec validated against a "not" condition. The reporter doesn't know what part of the spec failed. That's why there's the "FAILED ON: " workaround, where I expose the object on which the test failed in the error message.
As far as I know, there's not much to do about this yet. There's the "contains" keyword coming up (hopefully) in a future JSON Schema draft, but even then I'm not certain if it's descriptive enough.
So we need to figure out how to properly do an "array contains..." so that the validation error is still expressive enough to be informative.
The text was updated successfully, but these errors were encountered:
Currently the only way (I have found) to test if an array (window.dataLayer) simply contains an object is to use the
pattern as used in /lib/testUtils.js. However, this is not only really ugly, but it also lacks proper validation error messages. If the test fails, the only thing the reporter knows is that the spec validated against a "not" condition. The reporter doesn't know what part of the spec failed. That's why there's the
"FAILED ON: "
workaround, where I expose the object on which the test failed in the error message.As far as I know, there's not much to do about this yet. There's the "contains" keyword coming up (hopefully) in a future JSON Schema draft, but even then I'm not certain if it's descriptive enough.
So we need to figure out how to properly do an "array contains..." so that the validation error is still expressive enough to be informative.
The text was updated successfully, but these errors were encountered: