# test.govlab/docs/core/normalizers/reference.normalizer.test.ts

> 18 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-docs-core-normalizers-reference-normalizer-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/docs/core/normalizers/reference.normalizer.test.ts.txt

Listed in [test.govlab/docs/core/normalizers](https://banes-lab.com/api/source/testing/test.govlab/docs/core/normalizers.md), after [test.govlab/docs/core/normalizers/diagram.normalizer.test.ts](https://banes-lab.com/source/testing/test.govlab/docs/core/normalizers/diagram.normalizer.test.ts.md).

## Contained in

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

## Source

```typescript
import {
    cleanTarget,
    normalizeTarget,
    unquote,
    withoutFragment,
} from "@govlab/docs/core/normalizers/reference.normalizer.ts";
import { describe, expect, it } from "vitest";

describe("the target normalizers", () => {
    it("strip quotes, fragments, trailing slashes and line suffixes", () => {
        expect([unquote('"a.md"'), unquote("'a.md'"), unquote('"')]).toStrictEqual(["a.md", "a.md", '"']);
        expect(withoutFragment("a.md#part")).toBe("a.md");
        expect(cleanTarget('"a.md#part"')).toBe("a.md");
        expect(normalizeTarget("src/a.ts:10-12")).toBe("src/a.ts");
        expect(normalizeTarget("src/a.ts:4:9")).toBe("src/a.ts");
        expect(normalizeTarget("src/")).toBe("src");
        expect(normalizeTarget("src/a.ts:x")).toBe("src/a.ts:x");
    });
});
```
