# test.govlab/docs/core/plugins/manifest.catalog.plugin.test.ts

> 38 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-docs-core-plugins-manifest-catalog-plugin-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/docs/core/plugins/manifest.catalog.plugin.test.ts.txt

Listed in [test.govlab/docs/core/plugins](https://banes-lab.com/api/source/testing/test.govlab/docs/core/plugins.md), after [test.govlab/docs/core/plugins/diagram.shell.plugin.test.ts](https://banes-lab.com/source/testing/test.govlab/docs/core/plugins/diagram.shell.plugin.test.ts.md) and before [test.govlab/docs/core/plugins/manifest.domain.plugin.test.ts](https://banes-lab.com/source/testing/test.govlab/docs/core/plugins/manifest.domain.plugin.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import type { ManifestModule } from "@govlab/docs/types/manifest.types.ts";
import { plugin } from "@govlab/docs/core/plugins/manifest.catalog.plugin.ts";

const MODULE: ManifestModule = {
    dir: "",
    ecosystemHint: "go",
    group: "x",
    label: "x",
    manifest: {},
    pkg: {},
    relPath: "x",
    slug: "x",
};

describe("the catalog manifest plugin", () => {
    it("writes the spine, the transitive requirements, the relationships and the ecosystem", () => {
        const entry = { category: null, value: "x" };
        const manifest = {
            ecosystem: "typescript",
            label: "X",
            maturity: "stable",
            overlaps: [{ package: "@govlab/other", reason: "shares a job" }],
            summary: "y",
        };
        plugin.contribute?.(manifest, entry, { module: MODULE, requires: () => ["a", "b"] });
        expect(entry).toMatchObject({
            ecosystem: "typescript",
            label: "X",
            maturity: "stable",
            overlaps: [{ package: "other", reason: "shares a job" }],
            requires: ["a", "b"],
        });
    });

    it("falls back to the slug and the detected ecosystem", () => {
        const entry = { category: null, value: "x" };
        plugin.contribute?.({}, entry, { module: MODULE, requires: () => [] });
        expect(entry).toMatchObject({ ecosystem: "go", label: "x" });
    });
});
```
