assert.ts
This file
Path
adapters/deno/test/assert.ts
11 lines · 393 bytes · TypeScript
Last changed by
test: move adapter runtime tests into `adapters/*` (#5466)Yusuke Wadabefore adoption645ddd6
History of this fileTake it
test: move adapter runtime tests into `adapters/*` (#5466)Yusuke Wadabefore adoption645ddd6
lines 1–11why, one step back1export const assertEquals = (actual: unknown, expected: unknown): void => {2 if (actual !== expected) {3 throw new Error(`Expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`)4 }5}67export const assertMatch = (actual: string, expected: RegExp): void => {8 if (!expected.test(actual)) {9 throw new Error(`Expected ${JSON.stringify(actual)} to match ${expected}`)10 }11}