# test.govlab/docs/core/parsers/export.parser.test.ts

> 21 lines of code and 0 definitions.

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

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

## Contained in

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

## Source

```typescript
import { barrelExports, exportedNames } from "@govlab/docs/core/parsers/export.parser.ts";
import { describe, expect, it } from "vitest";
import { absolutePath } from "@ssot/paths";
import { join } from "node:path";

const PARSER = join(absolutePath("govlab.docs"), "core", "parsers", "export.parser.ts");
const BARREL = join(absolutePath("govlab.docs"), "index.ts");

describe("exportedNames", () => {
    it("reads the exported names of a source file and omits the internal ones", () => {
        const names = exportedNames(PARSER);
        expect(names.has("exportedNames")).toBe(true);
        expect(names.has("barrelExports")).toBe(true);
        expect(names.has("sourceOf")).toBe(false);
    });
});

describe("barrelExports", () => {
    it("reads each re-exported value of a barrel", () => {
        const names = barrelExports(BARREL).map((entry) => entry.name);
        expect(names).toContain("computeLocation");
        expect(names).toContain("createModuleDocs");
    });
});
```
