acquit-require
Utility to pull mocha tests into markdown, HTML, etc.
transform()
This is the function you want to use. Given a string
(markdown, HTML, Jade, etc.) and the raw source code of some mocha tests,
this function returns a string with [require:bar]
replaced with the
source code of the first test that matches the regexp 'bar'.
Given the below markdown article
:
Printing "Hello, World" in JavaScript is easy:
```
[require:bar]
```
This is how you print "Bye!" instead:
```
[require:baz]
```
And the below mocha test code
:
;
The transform()
function will pull the source code of the two tests into
your markdown file.
const output = ; const logStatements = output; assert; assert; assert;
findTest()
assert; assert; assert; assert; assert;