mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
23 lines
591 B
JavaScript
23 lines
591 B
JavaScript
//.webstorm.bootstrap.js
|
|
const chai = require('chai');
|
|
const fs = require('fs');
|
|
global.chai = chai;
|
|
global.expect = chai.expect;
|
|
global.showdown = require('../.build/showdown.js');
|
|
global.getDefaultOpts = require('./optionswp.js').getDefaultOpts;
|
|
|
|
// 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;
|