const NodeEnvironment = require('jest-environment-node');
const undom = require('undom');
require('./register');

module.exports = class extends NodeEnvironment {
  constructor(config) {
    super(config);
    const window = undom().defaultView;
    Object.getOwnPropertyNames(global).forEach(n => (window[n] = global[n]));
    Object.assign(this.context, window, { window });
  }
};

const NodeEnvironment = require('jest-environment-node');
const undom = require('undom');
require('./register');

module.exports = class extends NodeEnvironment {
  constructor(config) {
    super(config);
    const window = undom().defaultView;
    Object.getOwnPropertyNames(global).forEach(n => (window[n] = global[n]));
    Object.assign(this.context, window, { window });
  }
  setup() {
    return Promise.resolve();
  }
  teardown() {
    return Promise.resolve();
  }
};

Add support for Jest 22 envs.
Add support for Jest 22 envs.
