rinse0ut/scrabble

View on GitHub
test/setup.js

Summary

Maintainability
A
0 mins
Test Coverage
import { jsdom } from 'jsdom'

let exposedProperties = ['window', 'navigator', 'document'];

global.document = jsdom('');
global.window = document.defaultView;
Object.keys(document.defaultView).forEach((property) => {
  if (typeof global[property] === 'undefined') {
    exposedProperties.push(property);
    global[property] = document.defaultView[property];
  }
});

global.navigator = {
  userAgent: 'node.js'
};