text-testing monorepo.
It is testing library for texts.
You can use text-testing-mocha for testing texts. For example, you want to test that "What is this?" section should contain "It is". You can write the test using text-testing-mocha by following code.
readme-test.js
:
const tester = require("text-testing-mocha");
const fs = require("fs");
const content = fs.readFileSync("README.md", "utf-8");
tester(content, (section) => {
section("What is this?", (test) => {
test("testing library");
});
});
Run the test via Mocha.
$ mocha readme-test.js
What is this?
✓ testing library
Assertion library for natural language.
Testing library that using text-testing for Mocha.
Create "Section" node from TxtAST.
See Releases page.
Install devDependencies and Run npm test
:
npm i -d && npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT © azu