# test.web/core/loaders/definition.loader.test.ts

> 12 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-web-core-loaders-definition-loader-test-ts
Source text: https://banes-lab.com/source/testing/test.web/core/loaders/definition.loader.test.ts.txt

Listed in [test.web/core/loaders](https://banes-lab.com/api/source/testing/test.web/core/loaders.md), before [test.web/core/loaders/diagram.loader.test.ts](https://banes-lab.com/source/testing/test.web/core/loaders/diagram.loader.test.ts.md).

## Contained in

- [test.web/core/loaders](https://banes-lab.com/anatomy/testing/folder-testing-test-web-core-loaders.md)

## Source

```typescript
import { describe, expect, it } from "vitest";
import { listDefinitions, locateNode } from "@banes-lab/web/core/loaders/definition.loader.ts";

describe("locateNode", () => {
    it("locates a definition the trees hold, and answers nothing for a node that names nothing", () => {
        const [first] = listDefinitions();
        if (first === undefined) {
            throw new Error("the anatomy trees hold no definition");
        }
        expect(locateNode({ file: first.file, kind: "definition", name: first.name })).not.toBeNull();
        expect(locateNode({ kind: "file", name: "no-such-file.ts" })).toBeNull();
    });
});
```
