1
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
markdown-it-katex/test/all.js

28 lines
642 B
JavaScript
Raw Normal View History

2016-04-22 02:40:31 +09:00
var path = require('path'),
tape = require('tape'),
testLoad = require('markdown-it-testgen').load,
2016-04-22 02:06:29 +09:00
mdk = require('../index');
2016-04-22 02:40:31 +09:00
var md = require('markdown-it')()
.use(mdk);
2016-04-22 02:06:29 +09:00
2016-04-22 02:40:31 +09:00
/* 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){
2016-04-22 02:06:29 +09:00
2016-04-22 03:01:05 +09:00
/* generic test definition code using tape */
2016-04-22 02:40:31 +09:00
tape(fixture.header, function(t){
t.plan(1);
var expected = fixture.second.text,
actual = md.render(fixture.first.text);
t.equals(actual, expected);
});
2016-04-22 03:01:05 +09:00
2016-04-22 02:40:31 +09:00
});
2016-04-22 02:06:29 +09:00
});