# test.govlab/quality/core/parsers/tool.yamllint.parser.test.ts

> 17 lines of code and 0 definitions.

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

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

## Contained in

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

## Source

```typescript
import { expect, test } from "vitest";
import { parseYamllintOutput } from "@govlab/quality/core/parsers/tool.yamllint.parser.ts";

const COLUMN = 5;

test("parseYamllintOutput reads the parsable format and keeps the rule id from the trailing parentheses", () => {
    const output = "a.yml:2:5: [error] trailing spaces (trailing-spaces)\nnoise\n";
    const findings = parseYamllintOutput(output, "yaml");
    expect(findings).toHaveLength(1);
    expect(findings[0]).toMatchObject({
        column: COLUMN,
        file: "a.yml",
        line: 2,
        message: "trailing spaces",
        ruleId: "trailing-spaces",
        tool: "yamllint",
    });
    expect(parseYamllintOutput("a.yml:1:1: [warning] no rule id", "yaml")[0]?.ruleId).toBe("yamllint");
});
```
