Permalink
Browse files

upgrade dev dependencies (#1085)

  • Loading branch information...
nataly87s committed Jan 28, 2019
1 parent eac29bc commit dd7dfd04496f740c5b88fd30375c48f998fead56
@@ -24,33 +24,33 @@
"teardown": "yarn docker-compose down --remove-orphans",
"docker-compose": "docker-compose -f ./deployments/dev/docker-compose.yml -f ./deployments/dev/docker-compose.override.yml",
"docker-compose:e2e": "yarn docker-compose -f ./deployments/dev/docker-compose.e2e.yml",
"format": "prettier-eslint --trailing-comma all --print-width 100 --single-quote --write",
"format:ts": "tsfmt -r",
"format:go": "gofmt -l -w",
"precommit": "lint-staged"
"format:go": "gofmt -l -w"
},
"devDependencies": {
"husky": "^0.14.3",
"lint-staged": "^6.0.0",
"husky": "^1.3.1",
"lint-staged": "^8.1.0",
"npm-run-all": "^4.1.5",
"prettier": "^1.9.0",
"prettier-eslint-cli": "^4.4.2",
"typescript-formatter": "^7.0.0"
"prettier": "^1.16.1"
},
"lint-staged": {
"linters": {
"**/*.js": [
"yarn format",
"git add"
],
"**/*.ts": [
"yarn format:ts",
"git add"
],
"**/*.go": [
"yarn format:go",
"git add"
]
"prettier": {
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "always"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,json,css,md}": [
"prettier --write",
"git add"
],
"*.go": [
"yarn format:go",
"git add"
]
}
}
@@ -10,7 +10,7 @@ FROM dependencies AS build
RUN yarn --prefer-offline

COPY . .
RUN yarn test && yarn build
RUN CI=true yarn test && yarn build

# ---- Release ----
FROM dependencies AS release
@@ -16,17 +16,12 @@
"build": "run-s -l build:*",
"build:less": "node-less-chokidar src/",
"build:app": "react-app-rewired build",
"test": "jest",
"test": "react-scripts test",
"eject": "react-scripts eject",
"teardown": "yarn docker-compose down --remove-orphans",
"logs": "yarn docker-compose logs",
"docker-compose": "docker-compose -f ../../deployments/dev/docker-compose.yml -f ../../deployments/dev/docker-compose.override.yml -f ../../deployments/dev/docker-compose.local-editor.yml"
},
"jest": {
"testRegex": "/spec/unit/.*\\.js$",
"coverageDirectory": "./coverage-unit/",
"collectCoverage": true
},
"dependencies": {
"adal-angular": "1.0.17",
"animakit-expander": "^2.1.4",
@@ -82,26 +77,15 @@
"velocity-react": "^1.3.3"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-loader": "^7.1.4",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"chai": "^4.1.2",
"chai-things": "^0.2.0",
"copy-webpack-plugin": "4.5.1",
"eslint": "^4.19.1",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"fetch-mock": "^6.3.0",
"node-less-chokidar": "^0.1.2",
"node-less-chokidar": "^0.4.1",
"nodemon": "^1.17.3",
"npm-run-all": "^4.1.5",
"react-app-rewired": "1.5.0",
"react-scripts": "1.1.2",
"react-app-rewired": "2.0.2",
"react-scripts": "2.1.3",
"react-test-renderer": "^16.3.0",
"rimraf": "^2.6.2"
}
@@ -1,8 +1,6 @@
/* global jest, before, beforeEach, describe, it, expect */
import { assert, expect } from 'chai';
import * as RulesUtils from '../../../../src/components/JPadFullEditor/rules-utils';

jest.unmock('../../../../src/components/JPadFullEditor/rules-utils');
import * as RulesUtils from './rules-utils';

const toExplicitRule = (Value, ...matchers) => ({
Matcher: matchers.reduce((result, matcher) => ({ ...result, [matcher]: 'matcherValue' }), {}),
@@ -1,7 +1,7 @@
/* global jest, before, beforeEach, describe, it, expect */
import React from 'react';
import renderer from 'react-test-renderer';
import ErrorHandler from '../../../../src/components/common/ErrorHandler';
import ErrorHandler from './ErrorHandler';

const ErrorComponent = () => {
throw 'error';
@@ -12,9 +12,9 @@ exports[`ErrorHandler component should render original component correctly 1`] =
Array [
<div>
some element
</div>,
</div>,
<div>
another element
</div>,
</div>,
]
`;
@@ -1,10 +1,7 @@
/* global jest, beforeEach, describe, it, expect */
jest.unmock('../../../src/pages/keys/components/KeyPage/KeyAddPage/key-name-validations');
jest.unmock('chance');

import { assert, expect } from 'chai';
import keyNameValidations from '../../../src/pages/keys/components/KeyPage/KeyAddPage/key-name-validations';
import { BLANK_KEY_NAME } from '../../../src/store/ducks/ducks-utils/blankKeyDefinition';
import { BLANK_KEY_NAME } from '../../../../../store/ducks/ducks-utils/blankKeyDefinition';
import keyNameValidations from './key-name-validations';

describe('key-name-validations', () => {
const categoryName1 = 'someCategoryName1';
@@ -1,10 +1,8 @@
/* global describe it afterEach */
/* global describe, it, afterEach */
import fetchMock from 'fetch-mock';

import chai, { expect } from 'chai';
import chaiThings from 'chai-things';

import * as AuthService from '../../../src/services/auth-service';
import * as AuthService from './auth-service';

chai.use(chaiThings);

@@ -1,6 +1,6 @@
/* global jest, before, beforeEach, describe, it, expect */
jest.unmock('../../../src/services/context-service');
jest.mock('../../../src/services/types-service', () => ({
/* eslint-disable import/first */
/* global jest, before, beforeEach, afterEach, describe, it, expect, require */
jest.mock('./types-service', () => ({
types: {
string: { name: 'string' },
version: { name: 'version', base: 'string' },
@@ -9,7 +9,8 @@ jest.mock('../../../src/services/types-service', () => ({

import fetchMock from 'fetch-mock';
import chai, { assert, expect } from 'chai';
import * as ContextService from '../../../src/services/context-service';
import * as ContextService from './context-service';

chai.use(require('chai-things'));

describe('context-service', () => {
@@ -1,6 +1,7 @@
import { types } from '../../../src/services/types-service';
import * as opsProvider from '../../../src/services/operators-provider';
/* global describe, it */
import { expect } from 'chai';
import { types } from './types-service';
import * as opsProvider from './operators-provider';

describe('operators-provider service', () => {
it('should contain the right operators for date', () => {
@@ -1,8 +1,6 @@
/* global jest, before, beforeEach, describe, it, expect */
jest.unmock('../../../src/services/types-service');

/* global jest, before, beforeEach, afterEach, describe, it, expect */
import fetchMock from 'fetch-mock';
import * as TypesService from '../../../src/services/types-service';
import * as TypesService from './types-service';

describe('types-service', () => {
afterEach(() => {
@@ -32,18 +30,18 @@ describe('types-service', () => {
});

describe('convertValue', () => {
TypesService['version'] = {
TypesService.types.version = {
name: 'version',
base: 'string',
};

let checkConvertedValueResult = function (value, type, expectedResult) {
let checkConvertedValueResult = function(value, type, expectedResult) {
it('should convert values correctly', () => {
expect(TypesService.convertValue(value, type)).toEqual(expectedResult);
});
};

let shouldFailResult = function (value, type) {
let shouldFailResult = function(value, type) {
it('should convert values correctly', () => {
expect(() => TypesService.convertValue(value, type)).toThrow();
});
@@ -1,6 +1,6 @@
/* eslint-disable import/first */
/* global jest, beforeEach, describe, it, expect */
jest.unmock('../../../../../src/store/ducks/ducks-utils/validations/key-value-type-validations');
jest.mock('../../../../../src/services/types-service', () => ({
jest.mock('../../../../services/types-service', () => ({
types: {
string: { name: 'string' },
boolean: { name: 'boolean' },
@@ -9,11 +9,11 @@ jest.mock('../../../../../src/services/types-service', () => ({
}));

import { assert } from 'chai';
import keyValueTypeValidation from '../../../../../src/store/ducks/ducks-utils/validations/key-value-type-validations';
import keyValueTypeValidation from './key-value-type-validations';

describe('key-value-type-validations', () => {
let checkTypeValidation = function (type, shouldBeValid) {
it('should return ' + (shouldBeValid ? 'valid' : 'invalid') + ' for type ' + type, () => {
let checkTypeValidation = function(type, shouldBeValid) {
it(`should return ${shouldBeValid ? 'valid' : 'invalid'} for type ${type}`, () => {
expect(keyValueTypeValidation(type).isValid).toEqual(shouldBeValid);
});
};
@@ -5,8 +5,8 @@ import jsonpatch from 'fast-json-patch';
import { createStore, applyMiddleware, combineReducers } from 'redux';
import * as R from 'ramda';
import { expect } from 'chai';
import reducer, * as actions from '../../../../src/store/ducks/schema';
import { toAbsoluteUrl } from '../../../../src/utils/fetch';
import { toAbsoluteUrl } from '../../utils/fetch';
import reducer, * as actions from './schema';

describe('schema duck', () => {
let schemaState, dispatch;
@@ -63,7 +63,7 @@ describe('schema duck', () => {
global.fetch = jest.fn(async (url, fetchArgs) => {
fetchArgs = fetchArgs || { method: 'get' };
if (fetchArgs.url === '/api/schemas' && fetchArgs.method.toUpperCase() === 'GET') {
return { ok: true, json: async () => R.map(x => x.remote)(schemaState) };
return { ok: true, json: async () => R.map((x) => x.remote)(schemaState) };
}
return { ok: true, json: async () => ({}) };
});
@@ -1,38 +1,23 @@
/* global jest, beforeEach, describe, it, afterEach, expect Promise process */
/* eslint-disable import/first */
import { assert, expect } from 'chai';
import fetchMock from 'fetch-mock';
import * as R from 'ramda';

jest.unmock('../../../../src/store/ducks/tags');
jest.unmock('../../../../src/store/ducks/selectedKey');
jest.unmock('../../../../src/utils/http');
jest.unmock('../../../../src/store/ducks/ducks-utils/validations/key-value-type-validations');
jest.unmock('../../../../src/services/types-service');
jest.unmock('../../../../src/services/context-service');
jest.unmock('../../../../src/store/ducks/ducks-utils/blankKeyDefinition');
jest.mock('../../../../src/store/ducks/alerts', () => {
jest.mock('./alerts', () => {
let result = true;
const addAlert = dispatch => Promise.resolve({ result });
const addAlert = (dispatch) => Promise.resolve({ result });
return {
setResult: r => (result = r),
setResult: (r) => (result = r),
showCustomAlert: addAlert,
showAlert: addAlert,
showConfirm: addAlert,
};
});

import {
openKey,
saveKey,
changeKeyValueType,
updateKeyPath,
} from '../../../../src/store/ducks/selectedKey';
import {
createBlankJPadKey,
BLANK_KEY_NAME,
} from '../../../../src/store/ducks/ducks-utils/blankKeyDefinition';
import keyValueTypeValidations from '../../../../src/store/ducks/ducks-utils/validations/key-value-type-validations';
import { assert, expect } from 'chai';
import fetchMock from 'fetch-mock';
import * as R from 'ramda';
import { openKey, saveKey, changeKeyValueType, updateKeyPath } from './selectedKey';
import { createBlankJPadKey, BLANK_KEY_NAME } from './ducks-utils/blankKeyDefinition';
import keyValueTypeValidations from './ducks-utils/validations/key-value-type-validations';

describe('selectedKey', async () => {
const KEY_OPENED = 'KEY_OPENED';
@@ -104,11 +89,11 @@ describe('selectedKey', async () => {

const doesDispatchPushTookAction = () =>
dispatchMock.mock.calls
.map(x => x[0])
.some(x => x.payload && x.payload.method && x.payload.method === 'push');
.map((x) => x[0])
.some((x) => x.payload && x.payload.method && x.payload.method === 'push');

const doesSpecificDispatchTookAction = dispatchActionType =>
dispatchMock.mock.calls.map(x => x[0]).some(x => x.type === dispatchActionType);
const doesSpecificDispatchTookAction = (dispatchActionType) =>
dispatchMock.mock.calls.map((x) => x[0]).some((x) => x.type === dispatchActionType);

const assertDispatchAction = (actualDispatchAction, expectedDispatchAction) => {
expect(actualDispatchAction.type).to.deep.equal(
@@ -289,7 +274,7 @@ describe('selectedKey', async () => {
});
});

const saveKeyShouldShowValidationHints = isNewKey =>
const saveKeyShouldShowValidationHints = (isNewKey) =>
it('should not save the key and show the validation hints if the validation state is invalid', async () => {
// Arrang
const keyNameToSave = 'someCategory/someKeyName';
@@ -1,7 +1,5 @@
/* global jest, beforeEach, describe, it, expect */
jest.unmock('../../../src/utils/mutator');

import Mutator from '../../../src/utils/mutator';
import Mutator from './mutator';

describe('mutator tests', () => {
let newMutator = (fn) => {
@@ -158,7 +156,7 @@ describe('mutator tests', () => {
'should be able to adjust a field value',
newMutator((target, mutator) => {
target.someKey = 5;
mutator.in('someKey').adjustValue(x => x + 5);
mutator.in('someKey').adjustValue((x) => x + 5);
expect(target.someKey).toEqual(10);
}),
);
@@ -170,7 +168,7 @@ describe('mutator tests', () => {
mutator
.in('someArray')
.in(1)
.adjustValue(x => x + 10);
.adjustValue((x) => x + 10);
expect(target.someArray[1]).toEqual(30);
}),
);
@@ -279,7 +277,7 @@ describe('mutator tests', () => {
mutator.in('a').updateValue(1);
mutator.in('b').updateValue(1);
expect(mock.mock.calls.length).toEqual(2);
mutator.apply(m =>
mutator.apply((m) =>
m
.in('a')
.updateValue(2)
Oops, something went wrong.

0 comments on commit dd7dfd0

Please sign in to comment.