showdown/test/bootstrap.js
Estevão Soares dos Santos f9bc0ac97d add simple event trigger tests
2022-04-25 07:31:32 +01:00

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;