Hello! I’m working on a fairly small / simple Rust project that looks up some values from a KV Store item, does some JSON transformation, and returns a synthetic response (no origin / backend interaction).
I would love to write a handful of tests for this functionality.
I’ve searched around and have found a few resources that are useful, but not super up-to-date and also fairly simplistic. The most obvious resource is Fastly’s own post about this here: How to write Rust unit tests for your Compute application | Fastly - this is a good starting point, but is a bit old at this point (for me at least it doesn’t “just work”) and doesn’t cover stubbing services.
There is a also a community post here, but didn’t seem like any interaction there:
I’m aware the Rust community itself / documentation / examples, unrelated to Fastly, likely can help me figure out how to mock / stub in an external service (assuming this is possible in Rust to begin with), but the WASM angle / addition adds another step. Before I go down that path I figured I’d ask here if there might be any up-to-date Fastly examples of more complex testing with mocks and such?
Thanks for any advice!