Skip to content

Commit

Permalink
fix(env-browser): better support for external resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Igmat committed Mar 1, 2018
1 parent a56d1b1 commit c354f44
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/baset-env-browser/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { AbstractEnvironmet } from 'baset-core';
import { JSDOM } from 'jsdom';
import { ConstructorOptions, JSDOM } from 'jsdom';

const dom = new JSDOM();
// FIXME: seems like jsdom.d.ts is incorrect and `pretendToBeVisual` is missing
// tslint:disable-next-line:no-object-literal-type-assertion
const dom = new JSDOM('', {
resources: 'usable',
pretendToBeVisual: true,
} as ConstructorOptions);
Object.setPrototypeOf(global, dom.window);

export default class BrowserEnv extends AbstractEnvironmet {
Expand Down

0 comments on commit c354f44

Please sign in to comment.