datafoodconsortium / connector-typescript

The connector makes things easier when integrating with DFC. This is the TypeScript version.
MIT License
2 stars 1 forks source link

Document decision on testing strategy #13

Open RachL opened 4 months ago

RachL commented 2 months ago

@jgaehring as discussed in our meeting today, I will leave it to you to update here with a couple of sentences what was decided for the testing strategy of the Type script connector and close the issue. Many thanks!

jgaehring commented 1 week ago

The decision was to go ahead with using code generation for the TS tests, once datafoodconsortium/connector-codegen#20 is merged or possibly before, depending upon when and how work on that resumes.

Currently, all of the tests in connector-codegen-typescript have been hardcoded and are copied along with the other static modules. This is retained so far in datafoodconsortium/connector-codegen#20. However, there is an established pattern for generating tests in PHP that could be adapted to the TypeScript scenario, which is what we've decided to do here.

Before coming to that decision, I had raised the concern whether or not generating the tests themselves was considered a best practice, since it could theoretically introduce regressions or other bugs if errors in how the library implementation was generated were essentially duplicated in the generation of the tests. I don't recall the specific reasons, unfortunately (b/c I waited so long to write this up, argh! 🤦🏻), but @lecoqlibre provided sufficient rationale for why this would not be a problem.

I believe this is sufficient to close this now, @RachL, though I don't appear to have permissions to do so.