# test.govlab/quality/core/adapters/tool.clippy.adapter.test.ts

> 32 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-quality-core-adapters-tool-clippy-adapter-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/quality/core/adapters/tool.clippy.adapter.test.ts.txt

Listed in [test.govlab/quality/core/adapters](https://banes-lab.com/api/source/testing/test.govlab/quality/core/adapters.md), after [test.govlab/quality/core/adapters/tool.adapter.test.ts](https://banes-lab.com/source/testing/test.govlab/quality/core/adapters/tool.adapter.test.ts.md) and before [test.govlab/quality/core/adapters/tool.hadolint.adapter.test.ts](https://banes-lab.com/source/testing/test.govlab/quality/core/adapters/tool.hadolint.adapter.test.ts.md).

## Contained in

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

## Source

```typescript
import { clippyArgs, runClippy } from "@govlab/quality/core/adapters/tool.clippy.adapter.ts";
import { describe, expect, it } from "vitest";

describe("clippyArgs", () => {
    it("enables SSOT-mapped lints after `--` as `-W <lint>`", () => {
        expect(clippyArgs(["clippy::too_many_lines", "clippy::too_many_arguments"], false)).toEqual([
            "clippy",
            "--message-format",
            "json",
            "--",
            "-W",
            "clippy::too_many_lines",
            "-W",
            "clippy::too_many_arguments",
        ]);
    });

    it("omits the `--` separator when there are no lints to enable", () => {
        expect(clippyArgs([], false)).toEqual(["clippy", "--message-format", "json"]);
    });

    it("prepends the safe-autofix flags on the fix pass", () => {
        expect(clippyArgs([], true)).toEqual([
            "clippy",
            "--fix",
            "--allow-dirty",
            "--allow-no-vcs",
            "--message-format",
            "json",
        ]);
    });

    it("exposes the runner the registry dispatches", () => {
        expect(typeof runClippy).toBe("function");
    });
});
```
