hack-json-schema icon indicating copy to clipboard operation
hack-json-schema copied to clipboard

Fix how tests run so we don't rely on `assume_php`

Open mwildehahn opened this issue 5 years ago • 4 comments

Currently tests rely on:

  • parsing a JSON schema
  • generating a validator from it
  • using that validator to execute tests

If these test files are marked as strict, it creates a chicken and egg problem. The class needs to exist before we can test it, but we need to run the tests to generate the validator. This is especially problematic when there is an error in the generated code while developing. It's often times useful to delete the currently generated file and regenerate it -- which only works if we have assume_php=true and set the files to // partial.

mwildehahn avatar Jul 25 '19 16:07 mwildehahn

This is also absolutely required to support more recent versions of HHVM; assume_php was removed in 4.1

fredemmott avatar Jul 25 '19 16:07 fredemmott

This issue may be closed. We are not relying on assume_php.

lexidor avatar Jan 27 '20 21:01 lexidor

Yup looks like you're right. Marking all these as // strict then I think we can close this: https://github.com/slackhq/hack-json-schema/pull/31

mwildehahn avatar Jan 28 '20 00:01 mwildehahn

@mwildehahn This issue may be closed.

lexidor avatar Mar 14 '20 23:03 lexidor