1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
django-client-reverse-helper/test-helper.js

22 lines
455 B
JavaScript

import jsdom from 'jsdom';
import chai from 'chai';
import sinonChai from 'sinon-chai';
// Jsdom document & window
const doc = jsdom.jsdom('<!doctype html><html><body></body></html>');
const win = doc.defaultView;
// Add to global
global.document = doc;
global.window = win;
// Add window keys to global window
Object.keys(window).forEach((key) => {
if (!(key in global)) {
global[key] = window[key];
}
});
chai.expect();
chai.use(sinonChai);