mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
39 lines
992 B
JavaScript
39 lines
992 B
JavaScript
|
/**
|
||
|
* Created by Tivie on 21/12/2016.
|
||
|
*/
|
||
|
'use strict';
|
||
|
var fs = require('fs'),
|
||
|
showdown = require('../bootstrap').showdown,
|
||
|
converter = new showdown.Converter(),
|
||
|
pkg = require('../../package.json'),
|
||
|
performance = require('../performance/performance.js');
|
||
|
|
||
|
performance.setLibraryName(pkg.name);
|
||
|
performance.setVersion(pkg.version);
|
||
|
performance.setGithubLink('https://github.com/showdownjs/showdown/tree/');
|
||
|
|
||
|
var
|
||
|
runTests = function () {
|
||
|
new performance.Suite('Basic')
|
||
|
.setOption('cycles', 100)
|
||
|
.add('Simple "Hello World"', function () {
|
||
|
converter.makeHtml('*Hello* **World**!');
|
||
|
})
|
||
|
.add('readme.md', {
|
||
|
prepare: function () {
|
||
|
return fs.readFileSync('README.md', 'utf8');
|
||
|
},
|
||
|
test: function (mdText) {
|
||
|
converter.makeHtml(mdText);
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
generateLogs = function () {
|
||
|
performance.generateLog();
|
||
|
};
|
||
|
|
||
|
module.exports = {
|
||
|
runTests: runTests,
|
||
|
generateLogs: generateLogs
|
||
|
};
|