# test.rules/shared/matchers/vocabulary.matcher.test.ts

> 9 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-rules-shared-matchers-vocabulary-matcher-test-ts
Source text: https://banes-lab.com/source/testing/test.rules/shared/matchers/vocabulary.matcher.test.ts.txt

Listed in [test.rules/shared/matchers](https://banes-lab.com/api/source/testing/test.rules/shared/matchers.md), after [test.rules/shared/matchers/location.matcher.test.ts](https://banes-lab.com/source/testing/test.rules/shared/matchers/location.matcher.test.ts.md) and before [test.rules/shared/matchers/word.matcher.test.ts](https://banes-lab.com/source/testing/test.rules/shared/matchers/word.matcher.test.ts.md).

## Contained in

- [test.rules/shared/matchers](https://banes-lab.com/anatomy/testing/folder-testing-test-rules-shared-matchers.md)

## Source

```typescript
import { describe, expect, it } from "vitest";
import { numberedPhraseIn } from "@ssot/govlab/shared/matchers/vocabulary.matcher.ts";

describe("numberedPhraseIn", () => {
    it("finds a noun followed by a number as whole words, and nothing else", () => {
        expect(numberedPhraseIn("As Figure 2 shows, it holds.", ["figure"])).toBe("Figure 2");
        expect(numberedPhraseIn("The figures 2x agree.", ["figure"])).toBeNull();
        expect(numberedPhraseIn("No numbers here.", ["figure"])).toBeNull();
    });
});
```
