# Expect

`import { Expect } from "destack:test";`

A value assertion chain.

```ds title="Expect"
export struct Expect<T> {
    get not(): Expect<T>;
    check(condition: boolean, message: string, negatedMessage?: string | undefined): void;
    toEqual(expected: T): void;
    toBe(expected: T): void;
    toStrictEqual(expected: T): void;
    toContain<U>(expected: U): void;
    toBeTruthy(): void;
    toBeFalsy(): void;
    toBeNull(): void;
    toBeUndefined(): void;
    toBeDefined(): void;
    toBeGreaterThan<N: Numeric>(expected: float64): void;
    toBeLessThan<N: Numeric>(expected: float64): void;
}
```

[language/library/src/test/expect.ds:7:120](https://github.com/destack-sh/destack/blob/main/language/library/src/test/expect.ds#L7-L120)

## Members

### `get not(): Expect<T>`

Negated assertions.

### `check(condition: boolean, message: string, negatedMessage?: string | undefined): void`

Check one assertion result.

### `toEqual(expected: T): void`

Assert that the value equals `expected`.

### `toBe(expected: T): void`

Assert that the value strictly equals `expected`.

### `toStrictEqual(expected: T): void`

Assert that the value deeply equals `expected`.

### `toContain<U>(expected: U): void`

Assert that the value contains `expected`.

### `toBeTruthy(): void`

Assert that the value is true.

### `toBeFalsy(): void`

Assert that the value is false.

### `toBeNull(): void`

Assert that the value is null.

### `toBeUndefined(): void`

Assert that the value is undefined.

### `toBeDefined(): void`

Assert that the value is defined.

### `toBeGreaterThan<N: Numeric>(expected: float64): void`

Assert that the value is greater than `expected`.

### `toBeLessThan<N: Numeric>(expected: float64): void`

Assert that the value is less than `expected`.
