actionhero
Version:
The reusable, scalable, and quick node.js API server for stateless and stateful applications
17 lines (14 loc) • 665 B
text/typescript
import { Process, specHelper } from "./../../src/index";
import { RecursiveAction } from "../../src/actions/recursiveAction";
describe("Action: recursiveAction", () => {
const actionhero = new Process();
beforeAll(async () => await actionhero.start());
afterAll(async () => await actionhero.stop());
test("merges its own response with the randomNumber response", async () => {
const response =
await specHelper.runAction<RecursiveAction>("recursiveAction");
expect(response.local).toEqual(true);
expect(response.randomNumber).toBeGreaterThanOrEqual(0);
expect(response.stringRandomNumber).toMatch(/Your random number is/);
});
});