# test.govlab/pipeline/core/loaders/package.loader.test.ts

> 20 lines of code and 0 definitions.

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

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

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import { scopeFor, stepLabels } from "../factories/stage.fixture.ts";
import { selfGovernedSteps } from "@govlab/pipeline/core/loaders/package.loader.ts";
import { validationStage } from "@govlab/pipeline/core/factories/validation.factory.ts";

describe("selfGovernedSteps", () => {
    it("runs each declared script's own command inside its member, with no npm script between", () => {
        const steps = selfGovernedSteps();
        expect(steps.length).toBeGreaterThan(0);
        for (const step of steps) {
            expect(step.cwd).toBeDefined();
            expect(step.run?.startsWith("npm ")).toBe(false);
        }
    });

    it("joins the application's validation steps", () => {
        const labels = stepLabels(validationStage(scopeFor(["app"], false)));
        for (const step of selfGovernedSteps()) {
            expect(labels).toContain(step.label);
        }
    });
});
```
