@textlint/ast-tester
TypeScript icon, indicating that this package has built-in type declarations

14.6.0 • Public • Published

@textlint/ast-tester

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

It check compliance of AST at minimum.

If you have created 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.

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.1.0-alpha.0f2fd6f90canary
14.6.021,193latest
13.4.2-next.01next
12.0.0-beta.31beta

Version History

VersionDownloads (Last 7 Days)Published
14.6.021,193
14.5.02,480
14.4.27,225
14.4.11
14.4.01,887
14.3.0691
14.2.1305
14.2.0852
14.1.01
14.0.5547
14.0.42,199
14.0.3658
14.0.223
14.0.136
14.0.091
13.4.2-next.01
13.4.130,313
13.4.034
13.3.33,537
13.3.2634
13.3.1307
13.3.03
13.2.059
13.1.43
13.1.34
13.1.20
13.1.1102
13.1.086
13.0.58
13.0.40
13.0.31
13.0.23
13.0.11
13.0.00
12.6.110,607
12.6.01
12.5.20
12.5.041
12.3.03
12.2.389
12.2.2641
12.2.1773
12.2.00
12.1.12,184
12.1.01,885
12.0.2252
12.0.0270
12.0.0-beta.31
12.0.0-beta.20
12.0.0-beta.11
12.0.0-beta.00
2.3.52,684
2.3.430
2.3.30
2.3.247
2.3.10
2.3.00
2.2.5321
2.2.4102
2.2.31
2.2.21
2.2.10
2.2.00
2.1.6141
2.1.51
2.1.41
2.1.32
2.1.20
2.1.10
2.1.00
2.0.81
2.1.0-alpha.0f2fd6f90
2.1.0-alpha.bbfc8f6d0
2.0.70
2.0.62
2.0.50
2.0.41
2.0.30
2.0.20

Package Sidebar

Install

npm i @textlint/ast-tester

Weekly Downloads

75,024

Version

14.6.0

License

MIT

Unpacked Size

47.1 kB

Total Files

21

Last publish

Collaborators

  • azu
  • 0x6b
  • textlint-user