This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _Some = Symbol("some"); | |
const _None = Symbol("none"); | |
type Some<T> = { | |
type: typeof _Some; | |
value: T; | |
}; | |
type None = { | |
type: typeof _None; |