testTable.js 774 B

123456789101112131415161718192021222324
  1. var Showdown = require('../src/showdown');
  2. var fs = require('fs');
  3. module.exports = {
  4. setUp:function(callback) {
  5. this.showdown = new Showdown.converter({extensions:['table']});
  6. callback();
  7. },
  8. testMakeHtml:function(test) {
  9. var html = this.showdown.makeHtml("**blah**");
  10. console.log(html);
  11. test.equals(html ,'<p><strong>blah</strong></p>');
  12. test.done();
  13. },
  14. testMakeTable:function(test) {
  15. var md = fs.readFileSync('test/extensions/table/multiple-tables.md','UTF-8');
  16. var html = fs.readFileSync('test/extensions/table/multiple-tables.html','UTF-8');
  17. var result = this.showdown.makeHtml(md);
  18. console.log(result);
  19. test.equals(result, html);
  20. test.done();
  21. }
  22. };