# test.govlab/code-parse/configuration/strings/grammar.strings.test.ts

> 42 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-code-parse-configuration-strings-grammar-strings-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/code-parse/configuration/strings/grammar.strings.test.ts.txt

Listed in [test.govlab/code-parse/configuration/strings](https://banes-lab.com/api/source/testing/test.govlab/code-parse/configuration/strings.md).

## Contained in

- [test.govlab/code-parse/configuration/strings](https://banes-lab.com/anatomy/testing/folder-testing-test-govlab-code-parse-configuration-strings.md)

## Source

```typescript
import {
    BUILD_COMMAND,
    BUILD_SUMMARY,
    NO_TARBALL,
    UNKNOWN_FAILURE,
    buildFailed,
    builtLine,
    builtSummary,
    fetchFailedLine,
    fetchFailedNote,
    noParserSource,
    noteLine,
    wasmFailedLine,
    wroteLine,
} from "@govlab/code-parse/configuration/strings/grammar.strings.ts";
import { describe, expect, it } from "vitest";

describe("the grammar build lines", () => {
    it("end each terminal line with a newline and name the language", () => {
        for (const line of [
            builtLine("go", ["go"]),
            wasmFailedLine("go", "why"),
            fetchFailedLine("go", "why"),
            noteLine("skipped", "go"),
            fetchFailedNote("go"),
            buildFailed("why"),
            wroteLine(1, "map.json"),
            builtSummary(["go"]),
        ]) {
            expect(line.endsWith("\n")).toBe(true);
        }
        expect(builtLine("go", ["go", "mod"])).toContain("go,mod");
    });

    it("name the missing parser source, or the package root when no subfolder is declared", () => {
        expect(noParserSource("php")).toContain("php");
        expect(noParserSource()).toContain("<root>");
    });

    it("carry the contract and the fixed failure texts", () => {
        expect(BUILD_COMMAND).toContain("build:grammars");
        expect(BUILD_SUMMARY.endsWith(".")).toBe(true);
        expect(new Set([NO_TARBALL, UNKNOWN_FAILURE]).size).toBe(2);
    });
});
```
