Skip to main content Link Search Menu Expand Document (external link)

utils.ts overview

Since v0.21.0


Exports Grouped by Category


utils

assertEquals

Asserts that actual is equal to expected using the Equal.equals trait.

Signature

declare const assertEquals: <A>(actual: A, expected: A, message?: string, ..._: Array<never>) => void

Source

Since v0.21.0

assertFailure

Asserts that exit is a failure.

Signature

declare const assertFailure: <A, E>(
  exit: Exit.Exit<A, E>,
  expected: Cause.Cause<E>,
  ..._: Array<never>
) => asserts exit is Exit.Failure<never, E>

Source

Since v0.21.0

assertFalse

Asserts that self is false.

Signature

declare const assertFalse: (self: boolean, message?: string, ..._: Array<never>) => void

Source

Since v0.21.0

assertInclude

Asserts that actual includes expected.

Signature

declare const assertInclude: (actual: string | undefined, expected: string, ..._: Array<never>) => void

Source

Since v0.21.0

assertInstanceOf

Asserts that value is an instance of constructor.

Signature

declare const assertInstanceOf: <C extends abstract new (...args: any) => any>(
  value: unknown,
  constructor: C,
  message?: string,
  ..._: Array<never>
) => asserts value is InstanceType<C>

Source

Since v0.21.0

assertLeft

Asserts that either is Left.

Signature

declare const assertLeft: <R, L>(
  either: Either.Either<R, L>,
  expected: L,
  ..._: Array<never>
) => asserts either is Either.Left<L, never>

Source

Since v0.21.0

assertMatch

Asserts that actual matches regexp.

Signature

declare const assertMatch: (actual: string, regexp: RegExp, ..._: Array<never>) => void

Source

Since v0.21.0

assertNone

Asserts that option is None.

Signature

declare const assertNone: <A>(option: Option.Option<A>, ..._: Array<never>) => asserts option is Option.None<never>

Source

Since v0.21.0

assertRight

Asserts that either is Right.

Signature

declare const assertRight: <R, L>(
  either: Either.Either<R, L>,
  expected: R,
  ..._: Array<never>
) => asserts either is Either.Right<never, R>

Source

Since v0.21.0

assertSome

Asserts that option is Some.

Signature

declare const assertSome: <A>(
  option: Option.Option<A>,
  expected: A,
  ..._: Array<never>
) => asserts option is Option.Some<A>

Source

Since v0.21.0

assertSuccess

Asserts that exit is a success.

Signature

declare const assertSuccess: <A, E>(
  exit: Exit.Exit<A, E>,
  expected: A,
  ..._: Array<never>
) => asserts exit is Exit.Success<A, never>

Source

Since v0.21.0

assertTrue

Asserts that self is true.

Signature

declare const assertTrue: (self: unknown, message?: string, ..._: Array<never>) => asserts self

Source

Since v0.21.0

deepStrictEqual

Asserts that actual is equal to expected using the Equal.equals trait.

Signature

declare const deepStrictEqual: <A>(actual: A, expected: A, message?: string, ..._: Array<never>) => void

Source

Since v0.21.0

doesNotThrow

Asserts that thunk does not throw an error.

Signature

declare const doesNotThrow: (thunk: () => void, message?: string, ..._: Array<never>) => void

Source

Since v0.21.0

fail

Throws an AssertionError with the provided error message.

Signature

declare const fail: (message: string) => void

Source

Since v0.21.0

notDeepStrictEqual

Asserts that actual is not equal to expected using the Equal.equals trait.

Signature

declare const notDeepStrictEqual: <A>(actual: A, expected: A, message?: string, ..._: Array<never>) => void

Source

Since v0.21.0

strictEqual

Asserts that actual is equal to expected using the Equal.equals trait.

Signature

declare const strictEqual: <A>(actual: A, expected: A, message?: string, ..._: Array<never>) => void

Source

Since v0.21.0

throws

Asserts that thunk throws an error.

Signature

declare const throws: (thunk: () => void, error?: Error | ((u: unknown) => undefined), ..._: Array<never>) => void

Source

Since v0.21.0

throwsAsync

Asserts that thunk throws an error.

Signature

declare const throwsAsync: (
  thunk: () => Promise<void>,
  error?: Error | ((u: unknown) => undefined),
  ..._: Array<never>
) => Promise<void>

Source

Since v0.21.0