In fe34619 we degraded the hard error (ie. a `throw`)
for non-compliant field names (ie. starting with `__`) to a
We've found, however, that certain CI systems will treat the use of
`console.error` as a cause for failure, and our intent here is not to
block what would otherwise be a valid test run.
Switch to `console.warn` instead.
Eventually in a later release this will become a hard error, but for now
continuing to treat this like a "deprecation" and just warn is
This goes a step further than the parent commit, which downgrades
`console.error` to `console.warn` for cases that are really just
advisory "deprecation" warnings for non-compliant schemas.
The motivation in that commit was preventing CI failures stemming from
use of `console.error`.
That may not be enough though, because on some JS engines (notably
Chrome/Node), "Error: " still appears in the output thanks to our use of
`Error` objects to get stack traces. Depending on how the CI is set-up,
that could also be enough to spuriously fail the run.
So in this commit, we add a `formatWarning` helper that takes the
`Error` object and grooms it for use as a human-readable warning
Added tests to capture and verify the different engine behaviors.
To adequately serve as a deprecation warning, the message should provide
advance notice that it non-compliance will eventually become a hard
error. I haven't put a version number in there yet because I don't know
which version it will happen in. Once we make that call we should make
the message more precise.
All checks have passed
2 successful checks
— The Travis CI build passed