2022-03-27 08:05:30 +08:00
|
|
|
//.webstorm.bootstrap.js
|
2022-04-28 04:42:24 +08:00
|
|
|
const chai = require('chai');
|
|
|
|
const fs = require('fs');
|
2022-03-27 08:05:30 +08:00
|
|
|
global.chai = chai;
|
|
|
|
global.expect = chai.expect;
|
|
|
|
global.showdown = require('../.build/showdown.js');
|
|
|
|
global.getDefaultOpts = require('./optionswp.js').getDefaultOpts;
|
2022-04-28 04:42:24 +08:00
|
|
|
|
|
|
|
// mock XMLHttpRequest for browser and node test
|
|
|
|
function XMLHttpRequest () {
|
|
|
|
this.responseText = null;
|
|
|
|
this.status = null;
|
|
|
|
|
|
|
|
this.open = function (mode, file) {
|
|
|
|
//mode is ignored, it's always sync
|
|
|
|
this.responseText = fs.readFileSync(file);
|
|
|
|
this.status = 200;
|
|
|
|
return this;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
global.XMLHttpRequest = XMLHttpRequest;
|