Compliance tests for textlint's AST(Abstract Syntax Tree).
npm install @textlint/ast-testerCompliance tests for textlint's AST(Abstract Syntax Tree).
It check compliance of AST at minimum.
- textlint/txtnode.md at master · textlint/textlint
If you have created Processor plugin for textlint, you can use it for testing the plugin.
npm install -D @textlint/ast-tester
if the AST is invalid, then throw Error
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
1. Fork it!
2. Create your feature branch: git checkout -b my-new-featuregit commit -am 'Add some feature'
3. Commit your changes: git push origin my-new-feature`
4. Push to the branch:
5. Submit a pull request :D
MIT