From 2baf7d49b1deb24c49390b12eded9c7ddb32cdb4 Mon Sep 17 00:00:00 2001 From: jpellizzari Date: Wed, 26 Oct 2016 16:14:43 -0700 Subject: [PATCH] Changed client deps to work with Node v6.9 --- client/Dockerfile | 2 +- .../charts/__tests__/node-layout-test.js | 4 --- .../components/__tests__/node-details-test.js | 26 ++++++++++--------- .../scripts/reducers/__tests__/root-test.js | 8 ------ .../utils/__tests__/search-utils-test.js | 4 --- .../utils/__tests__/string-utils-test.js | 1 - .../utils/__tests__/topology-utils-test.js | 3 --- .../utils/__tests__/web-api-utils-test.js | 1 - client/package.json | 13 +++------- 9 files changed, 18 insertions(+), 44 deletions(-) diff --git a/client/Dockerfile b/client/Dockerfile index 7438af7d85..7221e8a65e 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,4 +1,4 @@ -FROM node:4.2.2 +FROM node:6.9.0 WORKDIR /home/weave COPY package.json /home/weave/ ENV NPM_CONFIG_LOGLEVEL=warn NPM_CONFIG_PROGRESS=false diff --git a/client/app/scripts/charts/__tests__/node-layout-test.js b/client/app/scripts/charts/__tests__/node-layout-test.js index 6583805755..7baa0d33e8 100644 --- a/client/app/scripts/charts/__tests__/node-layout-test.js +++ b/client/app/scripts/charts/__tests__/node-layout-test.js @@ -1,7 +1,3 @@ -jest.dontMock('../nodes-layout'); -jest.dontMock('../../utils/topology-utils'); -jest.dontMock('../../constants/naming'); // edge naming: 'source-target' - import { fromJS, Map } from 'immutable'; const makeMap = Map; diff --git a/client/app/scripts/components/__tests__/node-details-test.js b/client/app/scripts/components/__tests__/node-details-test.js index fa97047d3d..25a0bbc534 100644 --- a/client/app/scripts/components/__tests__/node-details-test.js +++ b/client/app/scripts/components/__tests__/node-details-test.js @@ -1,15 +1,8 @@ import React from 'react'; import Immutable from 'immutable'; import TestUtils from 'react/lib/ReactTestUtils'; - -jest.dontMock('../node-details.js'); -jest.dontMock('../node-details/node-details-controls.js'); -jest.dontMock('../node-details/node-details-relatives.js'); -jest.dontMock('../node-details/node-details-table.js'); -jest.dontMock('../node-details/node-details-health-overflow-item.js'); -jest.dontMock('../../hoc/metric-feeder.js'); -jest.dontMock('../../utils/color-utils'); -jest.dontMock('../../utils/title-utils'); +import { Provider } from 'react-redux'; +import configureStore from '../../stores/configureStore'; // need ES5 require to keep automocking off const NodeDetails = require('../node-details.js').NodeDetails; @@ -26,7 +19,11 @@ describe('NodeDetails', () => { }); it('shows n/a when node was not found', () => { - const c = TestUtils.renderIntoDocument(); + const c = TestUtils.renderIntoDocument( + + + + ); const notFound = TestUtils.findRenderedDOMComponentWithClass(c, 'node-details-header-notavailable'); expect(notFound).toBeDefined(); @@ -35,8 +32,13 @@ describe('NodeDetails', () => { it('show label of node with title', () => { nodes = nodes.set(nodeId, Immutable.fromJS({id: nodeId})); details = {label: 'Node 1'}; - const c = TestUtils.renderIntoDocument(); + const c = TestUtils.renderIntoDocument( + + + + ); const title = TestUtils.findRenderedDOMComponentWithClass(c, 'node-details-header-label'); expect(title.title).toBe('Node 1'); diff --git a/client/app/scripts/reducers/__tests__/root-test.js b/client/app/scripts/reducers/__tests__/root-test.js index c7238471bc..704b7c920a 100644 --- a/client/app/scripts/reducers/__tests__/root-test.js +++ b/client/app/scripts/reducers/__tests__/root-test.js @@ -1,11 +1,3 @@ -jest.dontMock('../../utils/router-utils'); -jest.dontMock('../../utils/search-utils'); -jest.dontMock('../../utils/string-utils'); -jest.dontMock('../../utils/topology-utils'); -jest.dontMock('../../utils/network-view-utils'); -jest.dontMock('../../constants/action-types'); -jest.dontMock('../root'); - const is = require('immutable').is; // Root reducer test suite using Jasmine matchers diff --git a/client/app/scripts/utils/__tests__/search-utils-test.js b/client/app/scripts/utils/__tests__/search-utils-test.js index 37bc76d60c..7fe24cbf96 100644 --- a/client/app/scripts/utils/__tests__/search-utils-test.js +++ b/client/app/scripts/utils/__tests__/search-utils-test.js @@ -1,7 +1,3 @@ -jest.dontMock('../search-utils'); -jest.dontMock('../string-utils'); -jest.dontMock('../../constants/naming'); // edge naming: 'source-target' - import { fromJS } from 'immutable'; const SearchUtils = require('../search-utils').testable; diff --git a/client/app/scripts/utils/__tests__/string-utils-test.js b/client/app/scripts/utils/__tests__/string-utils-test.js index a6ffb501e9..8d0ae43cc0 100644 --- a/client/app/scripts/utils/__tests__/string-utils-test.js +++ b/client/app/scripts/utils/__tests__/string-utils-test.js @@ -1,4 +1,3 @@ -jest.dontMock('../string-utils'); describe('StringUtils', () => { const StringUtils = require('../string-utils'); diff --git a/client/app/scripts/utils/__tests__/topology-utils-test.js b/client/app/scripts/utils/__tests__/topology-utils-test.js index 3a1dbd6973..083c031a33 100644 --- a/client/app/scripts/utils/__tests__/topology-utils-test.js +++ b/client/app/scripts/utils/__tests__/topology-utils-test.js @@ -1,6 +1,3 @@ -jest.dontMock('../topology-utils'); -jest.dontMock('../../constants/naming'); // edge naming: 'source-target' - import { fromJS } from 'immutable'; describe('TopologyUtils', () => { diff --git a/client/app/scripts/utils/__tests__/web-api-utils-test.js b/client/app/scripts/utils/__tests__/web-api-utils-test.js index fe52ac6371..a50e750141 100644 --- a/client/app/scripts/utils/__tests__/web-api-utils-test.js +++ b/client/app/scripts/utils/__tests__/web-api-utils-test.js @@ -1,4 +1,3 @@ -jest.dontMock('../web-api-utils'); import {OrderedMap as makeOrderedMap} from 'immutable'; diff --git a/client/package.json b/client/package.json index 650e59ccb4..ade7f32811 100644 --- a/client/package.json +++ b/client/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "autoprefixer": "6.3.3", - "babel-core": "6.7.2", + "babel-core": "6.10.4", "babel-eslint": "5.0.0", "babel-jest": "9.0.3", "babel-loader": "6.2.4", @@ -53,7 +53,7 @@ "html-webpack-plugin": "^2.16.0", "http-proxy-rules": "^1.0.1", "immutable-devtools": "0.0.6", - "jest-cli": "~0.9.2", + "jest-cli": "16.0.2", "json-loader": "0.5.4", "less": "~2.6.1", "less-loader": "2.2.2", @@ -89,22 +89,15 @@ }, "jest": { "scriptPreprocessor": "/node_modules/babel-jest", - "testFileExtensions": [ - "js" - ], "testPathDirs": [ "/app/scripts" ], "moduleFileExtensions": [ "js", "json" - ], - "unmockedModulePathPatterns": [ - "/dispatcher/", - "/node_modules/" ] }, "engines": { - "node": ">=4.2.2" + "node": "6.9.0" } }