Skip to content

Instantly share code, notes, and snippets.

View adregan's full-sized avatar
🛶
My other car is a canoe

Duncan Regan adregan

🛶
My other car is a canoe
View GitHub Profile
import { Result } from "./result";
describe("Result", () => {
describe("creating", () => {
describe("Result.ok()", () => {
test("it returns an ok result", () => {
const result = Result.ok("I'm good");
expect(result.isOk()).toBeTruthy();
});
import { Machine } from "./machine";
import { Context, State } from "./models";
describe("Machine", () => {
describe("Machine.create(state)", () => {
test("it returns an instance of state machine", () => {
const machine = Machine.create({ value: "saying.hello", context: {} });
expect(machine).toBeInstanceOf(Machine);
});
});
const _Some = Symbol("some");
const _None = Symbol("none");
type Some<T> = {
type: typeof _Some;
value: T;
};
type None = {
type: typeof _None;