# @textlint/ast-tester

> Compliance tests for textlint's AST(Abstract Syntax Tree).

Latest version **15.8.0** (published 2026-08-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @textlint/ast-tester
pnpm add @textlint/ast-tester
yarn add @textlint/ast-tester
bun add @textlint/ast-tester
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 15.8.0 |
| Published | 2026-08-01 |
| First published | 2018-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 31.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 3187 |
| Author | azu |
| Maintainers | azu, textlint-user |
| Keywords | ast, suite, test, testing, textlint |

## Links

- npm: https://www.npmjs.com/package/@textlint/ast-tester
- Repository: https://github.com/textlint/textlint
- Homepage: https://github.com/textlint/textlint/tree/master/packages/@textlint/ast-tester
- Issues: https://github.com/textlint/textlint/issues
- npm.io page: https://npm.io/package/@textlint/ast-tester

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^4.4.3
- [@textlint/ast-node-types](https://npm.io/package/@textlint/ast-node-types.md) 15.8.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 15.8.0 (latest) — 2026-08-01
- 13.4.2-next.0 (next) — 2024-02-02
- 12.0.0-beta.3 (beta) — 2021-05-24
- 2.1.0-alpha.0f2fd6f9 (canary) — 2018-07-16
- 15.7.1 — 2026-05-18
- 15.7.0 — 2026-05-14
- 15.6.1 — 2026-05-11
- 15.6.0 — 2026-04-26
- 15.5.4 — 2026-04-09
- 15.5.2 — 2026-02-21
- 15.5.1 — 2026-01-19
- 15.5.0 — 2025-12-07
- 15.4.1 — 2025-12-03
- 15.4.0 — 2025-11-17
- 15.3.0 — 2025-11-10
- … 91 more at https://npm.io/package/@textlint/ast-tester/versions

## README

# @textlint/ast-tester

Compliance tests for [textlint](https://github.com/textlint/textlint "textlint")'s AST(Abstract Syntax Tree).

It check compliance of AST at minimum.

- [textlint/txtnode.md at master · textlint/textlint](https://github.com/textlint/textlint/blob/master/docs/txtnode.md "textlint/txtnode.md at master · textlint/textlint")

If you have created [Processor](https://github.com/textlint/textlint/blob/master/docs/plugin.md "Processor") plugin for textlint, you can use it for testing the plugin.

## Installation

    npm install -D @textlint/ast-tester

## Usage

### `test(textlintAST): void`

if the AST is invalid, then throw Error

### `isTxtAST(textlintAST): boolean`

if the AST is valid, then return `true`.

```js
import {test, isTxtAST} from "@textlint/ast-tester";
import yourParse from "your-parser";
// recommenced: test much pattern test
const AST = yourParse("This is text");
test(AST);// if the AST is invalid, then throw Error

isTxtAST(AST);// true or false
```
## Tests

    npm test

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## License

MIT

---
_Source: https://npm.io/package/@textlint/ast-tester · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
