cli icon indicating copy to clipboard operation
cli copied to clipboard

Extensions: provide `PhylumApi` mocks for testing extensions through the CLI

Open andreaphylum opened this issue 3 years ago • 2 comments

We need to test extensions against API mocks, and figure out whether it is best to try and reuse the mocks already present in other tests or whether we may need to expand those/go in a different direction.

andreaphylum avatar Jun 08 '22 17:06 andreaphylum

I'm not sure we need a complete mock here (at least not for MVP). We definitely need a test that executes something with the deno API though (as @cd-work mentioned here)

Maybe that just means updating our sample extension so that it calls back into the rust code to do something trivial?

kylewillmon avatar Jun 09 '22 20:06 kylewillmon

Maybe that just means updating our sample extension so that it calls back into the rust code to do something trivial?

In this way we can test that we can reach that functionality (which sort of just works anyway) but we won't get a proper idea of the coverage for the serialization layer which is what concerns me -- i.e. having a solid, well-understood and non-surprising translation between V8 types and Rust types so that the API can cooperate effectively. This should also just work on the Rust side but I don't have enough experience with Deno to tell what caveats there may be in forming types on that side.

andreaphylum avatar Jun 10 '22 12:06 andreaphylum