ml-in-barcelona / jsoo-react

js_of_ocaml bindings for ReactJS. Based on ReasonReact.
https://ml-in-barcelona.github.io/jsoo-react
MIT License
138 stars 19 forks source link

Create a test case for capturing error messages at build(ppx)-time #87

Closed davesnx closed 2 years ago

davesnx commented 2 years ago

This test ensures that our error remains the same during new iterations. The test ensures that the ppx checks the validity of HTML attributes based on the HTML tag, since these operations happen at build-time we can run the ppx and capture it's stderr output and diff it against a snapshot.

With this method, we can't ensure that the type-checker works thought. There are methods to run the type-checker for example I'm doing it in styled-ppx https://github.com/davesnx/styled-ppx/blob/main/packages/ppx/test/native/Static_test.re and https://github.com/davesnx/styled-ppx/blob/main/packages/ppx/test/native/dune. We could look into those closely.

The PR merges all runtest into one action, to review the capturing error check: e549642 (#87)