You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
642 B
28 lines
642 B
1 month ago
|
var path = require('path'),
|
||
|
tape = require('tape'),
|
||
|
testLoad = require('markdown-it-testgen').load,
|
||
|
mdk = require('../index');
|
||
|
|
||
|
var md = require('markdown-it')()
|
||
|
.use(mdk);
|
||
|
|
||
|
/* this uses the markdown-it-testgen module to automatically generate tests
|
||
|
based on an easy to read text file
|
||
|
*/
|
||
|
testLoad(path.join(__dirname, 'fixtures/default.txt'), function(data){
|
||
|
data.fixtures.forEach(function (fixture){
|
||
|
|
||
|
/* generic test definition code using tape */
|
||
|
tape(fixture.header, function(t){
|
||
|
t.plan(1);
|
||
|
|
||
|
var expected = fixture.second.text,
|
||
|
actual = md.render(fixture.first.text);
|
||
|
|
||
|
t.equals(actual, expected);
|
||
|
|
||
|
});
|
||
|
|
||
|
});
|
||
|
});
|