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

15.1.1 • 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
12.0.0-beta.30beta
15.1.1848latest
13.4.2-next.02next

Version History

VersionDownloads (Last 7 Days)Published
15.1.1848
15.1.09,846
15.0.19,301
15.0.0145
14.8.47,206
14.8.316
14.8.1161
14.8.01,010
14.7.24,812
14.7.12,734
14.7.00
14.6.01,002
14.5.0687
14.4.25,783
14.4.11
14.4.0573
14.3.0759
14.2.1412
14.2.01,052
14.1.02
14.0.5155
14.0.43,569
14.0.3475
14.0.241
14.0.1107
14.0.0166
13.4.2-next.02
13.4.129,393
13.4.0126
13.3.35,659
13.3.2594
13.3.13,107
13.3.09
13.2.067
13.1.46
13.1.30
13.1.20
13.1.154
13.1.073
13.0.50
13.0.41
13.0.31
13.0.21
13.0.10
13.0.00
12.6.18,698
12.6.00
12.5.20
12.5.05
12.3.05
12.2.3257
12.2.2362
12.2.11,048
12.2.00
12.1.13,327
12.1.01,344
12.0.21,078
12.0.01,455
12.0.0-beta.30
12.0.0-beta.21
12.0.0-beta.10
12.0.0-beta.00
2.3.55,880
2.3.43,029
2.3.30
2.3.276
2.3.11
2.3.00
2.2.5482
2.2.42,649
2.2.31
2.2.20
2.2.10
2.2.00
2.1.61,191
2.1.50
2.1.40
2.1.30
2.1.20
2.1.10
2.1.01
2.0.80
2.1.0-alpha.0f2fd6f90
2.1.0-alpha.bbfc8f6d0
2.0.70
2.0.60
2.0.50
2.0.40
2.0.30
2.0.20

Package Sidebar

Install

npm i @textlint/ast-tester

Weekly Downloads

100,524

Version

15.1.1

License

MIT

Unpacked Size

31.9 kB

Total Files

13

Last publish

Collaborators

  • azu
  • 0x6b
  • textlint-user