# test.govlab/pipeline/core/stores/step.store.test.ts

> 16 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-pipeline-core-stores-step-store-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/pipeline/core/stores/step.store.test.ts.txt

Listed in [test.govlab/pipeline/core/stores](https://banes-lab.com/api/source/testing/test.govlab/pipeline/core/stores.md).

## Contained in

- [test.govlab/pipeline/core/stores](https://banes-lab.com/anatomy/testing/folder-testing-test-govlab-pipeline-core-stores.md)

## Source

```typescript
import { describe, expect, it } from "vitest";
import { createStepStore } from "@govlab/pipeline/core/stores/step.store.ts";

const OUTPUT = { label: "Lint", ok: true, out: "", stage: "linting" };

describe("createStepStore", () => {
    it("returns the collected outputs in the order they arrived", () => {
        const store = createStepStore();
        store.collect(OUTPUT);
        store.collect({ ...OUTPUT, label: "Format" });
        expect(store.outputs().map((entry) => entry.label)).toStrictEqual(["Lint", "Format"]);
    });

    it("keeps each store apart, so two runs never share outputs", () => {
        const first = createStepStore();
        first.collect(OUTPUT);
        expect(createStepStore().outputs()).toStrictEqual([]);
    });
});
```
