> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# testing: Programs and results

> Programs and results: the declaration and description of each of the 4 exports of @eco-incorp/sauce/testing.

`@eco-incorp/sauce/testing` runs programs on a local chain inside a test, in Node only. `fork(chain, options)` starts a copy of a real chain (an EVM chain at `options.block`) with the Sauce release, replaying a recorded state file, recording one, or reading the live chain; `local(options?)` starts an empty chain (Base unless `options.chain` names another, Solana included) with the Sauce release deployed and no Kitchen fee. An EVM chain runs on Foundry's `anvil`, which must be on `PATH`; Solana runs in LiteSVM.

```typescript theme={null}
import { fork, local, CookReverted } from "@eco-incorp/sauce/testing";
```

Generated from the type declarations of `@eco-incorp/sauce`.

### `CookReverted`

*Class* · `@eco-incorp/sauce/testing`

Thrown by a cook that reverts, with the reason when the revert data carries one.

```typescript theme={null}
export declare class CookReverted extends Error {
    readonly reason: string | undefined;
    readonly data: Hex | undefined;
    readonly logs?: readonly string[];
    constructor(reason: string | undefined, data: Hex | undefined, options?: {
        cause?: unknown;
        logs?: readonly string[];
        note?: string;
    });
}
```

### `CompiledProgram`

*Interface* · `@eco-incorp/sauce/testing`

```typescript theme={null}
export interface CompiledProgram {
    readonly path: string | undefined;
    readonly source: string;
    readonly chain: CanonicalChain;
    readonly bytecode: Hex;
    readonly params: ReadonlyArray<{
        readonly name: string;
        readonly type: string;
    }>;
    readonly returnType: string | undefined;
    readonly manifest?: AccountManifest;
    readonly derivedAccounts?: Readonly<Record<string, string>>;
    readonly stoppable?: readonly string[];
    readonly stoppableRuns?: CompiledSauceProgram["stoppableRuns"];
    readonly derivedValues?: CompiledSauceProgram["derivedValues"];
    held(stops: readonly string[]): CompiledProgram;
    payload(args?: readonly EntryValue[], stops?: readonly bigint[]): Hex;
    decode(data: Hex): Value | undefined;
}
```

### `ProgramInput`

*Type* · `@eco-incorp/sauce/testing`

A program file (a path, relative to the working directory, or a `file:` URL), or its source.

```typescript theme={null}
export type ProgramInput = string | URL | {
    readonly source: string;
    readonly path?: string;
};
```

### `Value`

*Type* · `@eco-incorp/sauce/testing`

What `main` returned, as it declares it: integers as `bigint`, addresses and bytes as hex.

```typescript theme={null}
export type Value = bigint | boolean | string | readonly Value[] | {
    readonly [field: string]: Value;
};
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.