# tests/core/readers/source.reader.test.ts

> 18 lines of code and 0 definitions.

Tree: Coordination tree
Language: typescript
Canonical: https://banes-lab.com/anatomy/coordination#file-coordination-tests-core-readers-source-reader-test-ts
Source text: https://banes-lab.com/assets/sources/source.49d32a95b9ad8c022485d71779268e4446bf75e4a7ca2296f60924d9a54cca7e.generated.txt

## Source

```typescript
import { describe, it } from "node:test";
import { importSource, importSources } from "../../../tools/core/readers/source.reader.ts";
import assert from "node:assert/strict";
import { fileURLToPath } from "node:url";

const SIBLING = fileURLToPath(new URL("../../../tools/core/readers/json.reader.ts", import.meta.url));

describe("importSource and importSources", () => {
    it("loads a module's exports, and reports a module that cannot load instead of throwing", async () => {
        const results = await importSources([SIBLING, `${SIBLING}.missing.ts`]);
        assert.deepEqual(
            results.map((result) => [typeof result.exports?.["tryParse"], result.error === null]),
            [
                ["function", true],
                ["undefined", false],
            ],
        );
        assert.equal((await importSource(SIBLING)).file, SIBLING);
    });
});
```
