From eb1ef06ae751b9da09de4551734540c9e7c283f2 Mon Sep 17 00:00:00 2001 From: akotynski Date: Mon, 23 Oct 2017 14:05:49 +0200 Subject: [PATCH] upgrade jsdom to newest version so contextify is no longer required, add travis --- .travis.yml | 4 ++++ dist/datasource-zabbix/specs/datasource_specs.js | 2 +- dist/datasource-zabbix/specs/test-main.js | 10 +++++----- dist/test/datasource-zabbix/specs/datasource_specs.js | 2 +- dist/test/datasource-zabbix/specs/test-main.js | 8 ++++---- package.json | 2 +- src/datasource-zabbix/specs/test-main.js | 10 +++++----- 7 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..534a81f91 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "6" +script: npm run build \ No newline at end of file diff --git a/dist/datasource-zabbix/specs/datasource_specs.js b/dist/datasource-zabbix/specs/datasource_specs.js index b814546b4..d81bd1988 100644 --- a/dist/datasource-zabbix/specs/datasource_specs.js +++ b/dist/datasource-zabbix/specs/datasource_specs.js @@ -235,7 +235,7 @@ describe('ZabbixDatasource', () => { }); }); - describe('When quering alerts', () => { + describe('When querying alerts', () => { let options = {}; beforeEach(() => { diff --git a/dist/datasource-zabbix/specs/test-main.js b/dist/datasource-zabbix/specs/test-main.js index cdaec558a..afc2cb78f 100644 --- a/dist/datasource-zabbix/specs/test-main.js +++ b/dist/datasource-zabbix/specs/test-main.js @@ -2,7 +2,7 @@ /* globals global: false */ import prunk from 'prunk'; -import {jsdom} from 'jsdom'; +import {JSDOM} from 'jsdom'; import chai from 'chai'; // import sinon from 'sinon'; import sinonChai from 'sinon-chai'; @@ -35,11 +35,11 @@ prunk.mock('app/core/utils/datemath', datemathMock); prunk.mock('angular', angularMocks); prunk.mock('jquery', 'module not found'); -// Setup jsdom // Required for loading angularjs -global.document = jsdom(''); -global.window = global.document.parentWindow; -global.navigator = window.navigator = {}; +let dom = new JSDOM(''); +// Setup jsdom +global.window = dom.window; +global.document = global.window.document; global.Node = window.Node; // Setup Chai diff --git a/dist/test/datasource-zabbix/specs/datasource_specs.js b/dist/test/datasource-zabbix/specs/datasource_specs.js index 31acd48cd..be3419fba 100644 --- a/dist/test/datasource-zabbix/specs/datasource_specs.js +++ b/dist/test/datasource-zabbix/specs/datasource_specs.js @@ -325,7 +325,7 @@ describe('ZabbixDatasource', function () { }); }); - describe('When quering alerts', function () { + describe('When querying alerts', function () { var options = {}; beforeEach(function () { diff --git a/dist/test/datasource-zabbix/specs/test-main.js b/dist/test/datasource-zabbix/specs/test-main.js index a80d33ad9..c48975c85 100644 --- a/dist/test/datasource-zabbix/specs/test-main.js +++ b/dist/test/datasource-zabbix/specs/test-main.js @@ -52,11 +52,11 @@ _prunk2.default.mock('app/core/utils/datemath', datemathMock); _prunk2.default.mock('angular', angularMocks); _prunk2.default.mock('jquery', 'module not found'); -// Setup jsdom // Required for loading angularjs -global.document = (0, _jsdom.jsdom)(''); -global.window = global.document.parentWindow; -global.navigator = window.navigator = {}; +var dom = new _jsdom.JSDOM(''); +// Setup jsdom +global.window = dom.window; +global.document = global.window.document; global.Node = window.Node; // Setup Chai diff --git a/package.json b/package.json index 5f9a127e5..6810d866f 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "grunt-sass": "^1.1.0", "grunt-systemjs-builder": "^0.2.5", "grunt": "~0.4.5", - "jsdom": "~3.1.2", + "jsdom": "~11.3.0", "jshint-stylish": "^2.1.0", "load-grunt-tasks": "~3.2.0", "mocha": "^2.4.5", diff --git a/src/datasource-zabbix/specs/test-main.js b/src/datasource-zabbix/specs/test-main.js index cdaec558a..afc2cb78f 100644 --- a/src/datasource-zabbix/specs/test-main.js +++ b/src/datasource-zabbix/specs/test-main.js @@ -2,7 +2,7 @@ /* globals global: false */ import prunk from 'prunk'; -import {jsdom} from 'jsdom'; +import {JSDOM} from 'jsdom'; import chai from 'chai'; // import sinon from 'sinon'; import sinonChai from 'sinon-chai'; @@ -35,11 +35,11 @@ prunk.mock('app/core/utils/datemath', datemathMock); prunk.mock('angular', angularMocks); prunk.mock('jquery', 'module not found'); -// Setup jsdom // Required for loading angularjs -global.document = jsdom(''); -global.window = global.document.parentWindow; -global.navigator = window.navigator = {}; +let dom = new JSDOM(''); +// Setup jsdom +global.window = dom.window; +global.document = global.window.document; global.Node = window.Node; // Setup Chai