[API reference](https://evolu.dev/docs/api-reference) › [@evolu/nodejs](https://evolu.dev/docs/api-reference/nodejs) › [TestBundle](https://evolu.dev/docs/api-reference/nodejs/TestBundle) › testBundle

```ts
function testBundle(
  __namedParameters: TestBundleOptions,
): Promise<Readonly<Record<string, Readonly<Record<string, TestBundleSize>>>>>;
```

Defined in: [packages/nodejs/src/TestBundle.ts:188](https://github.com/evoluhq/evolu/blob/59dabb7c56c68040b30d3919013adeb2b40bad10/packages/nodejs/src/TestBundle.ts#L188)

Bundles, executes, measures, and verifies named cases with every supported
bundler.

The fixture must default-export either a value, a promise, or a function that
returns one. The resolved value must be structured-cloneable so it can cross
the worker boundary. All asynchronous work started by the fixture must be
awaited by that returned promise; detached work scheduled after it settles is
outside the execution contract. Verification runs outside the measured
bundle. Each emitted bundle runs in an isolated worker so evaluation errors,
rejected promises, uncaught errors and unhandled rejections observed before
completion, and timeouts fail the test without affecting the test process.
Cases and bundlers form one flattened job list that runs concurrently,
bounded by the CPU parallelism available to the process. If multiple jobs
fail, all failures are reported together with their case and bundler names.
The returned record contains only raw and Brotli byte counts grouped by case
and versioned bundler name, so it can be compared directly with an inline
snapshot.

### Example

```ts

const directory = await mkdtemp(join(tmpdir(), "evolu-test-bundle-"));
try {
  const entryPath = join(directory, "entry.ts");
  await writeFile(entryPath, "export default { answer: 42 };\n");
  const result = await testBundle({
    cases: {
      example: {
        entryPath,
        verify: (value) => {
          expect(value).toEqual({ answer: 42 });
        },
      },
    },
  });
  for (const size of Object.values(result.example)) {
    expect(size.brotliSizeInBytes).toBeGreaterThan(0);
  }
} finally {
  await rm(directory, { recursive: true });
}
```