Tests
1. Getting Started
1.1. Basic test structure
import { runFunction /* types */ } from "@mimicprotocol/test-ts";
describe("Function", () => {
// 1. Define context, inputs, mocks
const functionDir = "./build";
const context = {
/* required fields */
};
const inputs = {
/* manifest inputs */
};
it("produces the expected intents", async () => {
// 2. Execute the function
const result = await runFunction(functionDir, context, {
inputs /* needed mocks */,
});
// 3. Check the function outputs
expect(result.success).to.be.true;
expect(result.intents).to.have.lengthOf(N);
});
});1.2. Project setup
2. Function Runner Reference
2.1. Parameters
2.2. Output
Last updated