Prim+RPC includes testing utilities to test itself over a generic event handler within the same file but while undergoing all of the typical events and transformations involved in sending RPC between two separated environments. This is useful for testing environments to ensure that functions can be used as RPC without the need to polyfill or set up real servers.
First, we’ll set up some module that we want to use with Prim+RPC:
And now we can set up our tests (we’ll use Vitest as an example):
That’s all there is to it!
You may also choose a compatible method plugin:
Report an Issue