# Context

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

Test callback context.

```ds title="Context"
export newtype interface Context {
    output: Dynamic<Output>;
    resource<T>(key: ResourceKey, create: () => T): T;
    cleanup(body: () => void | Promise<void>): void;
    snapshot<T>(name: string, value: T, options?: SnapshotOptions | undefined): void;
}
```

[language/library/src/test/result.ds:20:32](https://github.com/destack-sh/destack/blob/main/language/library/src/test/result.ds#L20-L32)

## Members

### `output: Dynamic<Output>`

Test output sink.

### `resource<T>(key: ResourceKey, create: () => T): T`

Create or return one resource.

### `cleanup(body: () => void | Promise<void>): void`

Clean up one resource after this run.

### `snapshot<T>(name: string, value: T, options?: SnapshotOptions | undefined): void`

Compare a value against a named snapshot.
