textlint-ast-test

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

MIT 11 个版本
安装
npm install textlint-ast-test
yarn add textlint-ast-test
pnpm add textlint-ast-test
bun add textlint-ast-test
README

textlint-ast-test

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-test

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-test";
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

版本列表
2.0.2 2018-01-12
2.0.1 2017-12-25
2.0.0 2017-12-18
2.0.0-next.0 2017-12-15
1.1.4 2017-06-12
1.1.3 2016-05-02
1.1.2 2016-03-19
1.1.1 2016-03-19
1.1.0 2016-03-19
1.0.2 2016-03-19
1.0.1 2016-03-19