repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

starfx / test
Eric Bower · 23 Feb 24

action.test.ts

 1import { describe, expect, it } from "../test.ts";
 2import { createAction } from "../mod.ts";
 3
 4const tests = describe("createAction()");
 5
 6it(tests, "should return action type when stringified", () => {
 7  const undo = createAction("UNDO");
 8  expect(`UNDO`).toEqual(`${undo}`);
 9});
10
11it(tests, "return object with type", () => {
12  const undo = createAction("UNDO");
13  expect(undo()).toEqual({ type: `UNDO`, payload: undefined });
14});