0x-mesh icon indicating copy to clipboard operation
0x-mesh copied to clipboard

[packages/browser] Improved DevEx for Conversion Tests

Open jalextowle opened this issue 4 years ago • 0 comments

Description

Several features were added to the Browser Conversion Tests in an attempt to approve the experience of writing new tests and modifying existing tests. Unfortunately, this was somewhat of a failure and the experience of working with the tests is suboptimal (I wrote the framework, so it's okay for me to say).

The obvious problems are that (1) the registered test cases are ordered, (2) the process of writing the Typescript component of the tests is not idiomatic or intuitive, and (3) the output of the tests is not as descriptive as it could be.

Low-hanging Fruit

  1. Use a map instead of an array to register test cases. This will automatically prevent the off-by-one issues that cause a cascading problem in the test's output.
  2. Import the mocha test framework into the Typescript component of the conversion tests and write logic on the Go side to interpret these logs intelligently.
  3. Treat the test output differently depending on whether the test failed or passed. Be more descriptive for failures, and generally format everything more nicely.

jalextowle avatar Mar 04 '20 00:03 jalextowle