Permalink
Browse files

feat(jsdom): update jsdom

  • Loading branch information...
JeroenVinke committed Jul 23, 2017
1 parent 348a272 commit d8e6239224c247609977792668c30c45c64905e0
Showing with 11 additions and 7 deletions.
  1. +2 −2 package.json
  2. +2 −2 spec/nodejs-dom.spec.ts
  3. +4 −1 src/global.ts
  4. +3 −2 src/nodejs-pal-builder.ts
View
@@ -29,11 +29,11 @@
},
"dependencies": {
"aurelia-pal": "^1.1.0",
"jsdom": "^9.8.3"
"jsdom": "^11.1.0"
},
"devDependencies": {
"@types/jasmine": "^2.2.34",
"@types/jsdom": "^2.0.29",
"@types/jsdom": "^11.0.1",
"aurelia-tools": "^0.2.4",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
View
@@ -1,6 +1,6 @@
import { initialize } from '../src/index';
import { DOM } from 'aurelia-pal';
import { jsdom } from 'jsdom';
import { JSDOM } from 'jsdom';
initialize();
@@ -43,7 +43,7 @@ describe('NodeJs Dom', () => {
});
it('adoptNode returns adopted', () => {
let external = jsdom(undefined).defaultView.window.document.createElement("DIV");
let external = new JSDOM(undefined, {}).window.document.createElement("DIV");
let adopted = DOM.adoptNode(external);
expect(adopted.nodeName).toBe("DIV");
View
@@ -1,6 +1,9 @@
export interface IGlobal extends Window {
import { DOMWindow, JSDOM } from 'jsdom';
export interface IGlobal extends DOMWindow {
MutationObserver: typeof MutationObserver;
Element: typeof Element;
jsdom: typeof JSDOM;
SVGElement: typeof SVGElement;
XMLHttpRequest: typeof XMLHttpRequest;
CustomEvent: typeof CustomEvent;
@@ -6,14 +6,15 @@ import { IFeature } from './feature';
import { NodeJsPlatform } from './nodejs-platform';
import { NodeJsFeature } from './nodejs-feature';
import { NodeJsDom } from './nodejs-dom';
import { jsdom } from 'jsdom';
import { JSDOM } from 'jsdom';
import { MutationObserver } from './polyfills/mutation-observer';
import { MutationNotifier } from './polyfills/mutation-observer';
let _patchedjsdom = false;
export function buildPal(): { global: IGlobal, platform: IPlatform, dom: IDom, feature: IFeature } {
var global: IGlobal = <IGlobal>jsdom(undefined, {}).defaultView;
var jsdom = new JSDOM(undefined, {});
var global: IGlobal = <IGlobal>jsdom.window;
if (!_patchedjsdom) {
patchNotifyChange(global);

0 comments on commit d8e6239

Please sign in to comment.