mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-07-20 23:15:44 +00:00
Fix unit tests (#248)
* Fix tests - Remove jest tests and add coverage - Rebase master and fix tests * Ignore local .vscode Add clean script * Fix deps - Upgrade deps - Switch to esnext * Move tests to the right folder * Deps cleanup and bump up * Remove root level package.json * Fix grumbles * Remove the labeler action due to https://github.com/actions/labeler/issues/12 * Fix grumbles
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
.nyc
|
||||
.nyc_output
|
||||
+32
-45
@@ -4,61 +4,48 @@
|
||||
"author": "Parity Technologies Ltd. <admin@parity.io>",
|
||||
"license": "GPL-3.0",
|
||||
"description": "Polkadot Telemetry frontend",
|
||||
"jest": {
|
||||
"moduleFileExtensions": [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js"
|
||||
],
|
||||
"setupFiles": [
|
||||
"jest-localstorage-mock"
|
||||
],
|
||||
"transform": {
|
||||
"\\.(ts|tsx)$": "ts-jest"
|
||||
},
|
||||
"testRegex": "/test/.*\\.(spec).(ts|tsx|js)$"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fnando/sparkline": "maciejhirsz/sparkline",
|
||||
"@polkadot/util-crypto": "^1.6.1",
|
||||
"@types/react-measure": "^2.0.5",
|
||||
"blakejs": "^1.1.0",
|
||||
"husky": "^4.2.3",
|
||||
"lint-staged": "^10.1.0",
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-measure": "^2.3.0",
|
||||
"react-scripts-ts": "2.17.0",
|
||||
"react-svg": "^4.1.1",
|
||||
"stable": "^0.1.8",
|
||||
"tslint": "^6.1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"precommit": "lint-staged",
|
||||
"start": "react-scripts-ts start",
|
||||
"build": "react-scripts-ts build",
|
||||
"test": "echo 'FIXME: FE tests need updating'",
|
||||
"test": "TS_NODE_PROJECT=tsconfig.test.json tape -r ts-node/register test/**/*spec.ts",
|
||||
"test:coverage": "nyc yarn test",
|
||||
"eject": "react-scripts-ts eject",
|
||||
"pretty:check": "prettier --check src/**/*.{ts,tsx}",
|
||||
"pretty:fix": "prettier --write src"
|
||||
"pretty:fix": "prettier --write src",
|
||||
"clean": "rm -rf node_modules build .nyc env-config.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fnando/sparkline": "maciejhirsz/sparkline",
|
||||
"@polkadot/util-crypto": "^2.8.1",
|
||||
"@types/react-measure": "^2.0.6",
|
||||
"blakejs": "^1.1.0",
|
||||
"husky": "^4.2.5",
|
||||
"lint-staged": "^10.1.3",
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-measure": "^2.3.0",
|
||||
"react-scripts-ts": "2.17.0",
|
||||
"react-svg": "^11.0.18",
|
||||
"stable": "^0.1.8",
|
||||
"tslint": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^23.0.2",
|
||||
"@types/node": "^10.3.2",
|
||||
"@types/react": "^16.3.17",
|
||||
"@types/react-dom": "^16.0.6",
|
||||
"@types/react-svg": "^3.0.0",
|
||||
"babel-jest": "^23.6.0",
|
||||
"@types/node": "^13.11.1",
|
||||
"@types/react": "^16.9.34",
|
||||
"@types/react-dom": "^16.9.6",
|
||||
"@types/react-svg": "^5.0.0",
|
||||
"@types/tape": "^4.2.34",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"enzyme": "^3.6.0",
|
||||
"enzyme-adapter-react-16": "^1.5.0",
|
||||
"jest": "^23.6.0",
|
||||
"jest-localstorage-mock": "^2.2.0",
|
||||
"mock-socket": "^8.0.2",
|
||||
"prettier": "^2.0.2",
|
||||
"react-test-renderer": "^16.5.2",
|
||||
"ts-jest": "^23.10.2",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"istanbul": "^0.4.5",
|
||||
"jest": "^25.3.0",
|
||||
"nyc": "^15.0.1",
|
||||
"prettier": "^2.0.4",
|
||||
"tape": "^4.13.2",
|
||||
"ts-node": "^8.8.2",
|
||||
"tslint": "^6.1.1",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"tslint-plugin-prettier": "^2.3.0",
|
||||
"typescript": "^2.9.2"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Types } from './common';
|
||||
import { State, UpdateBound } from './state';
|
||||
import { ConsensusDetail } from './common/types';
|
||||
|
||||
// Number of blocks which are kept in memory
|
||||
const BLOCKS_LIMIT = 50;
|
||||
|
||||
@@ -17,6 +17,12 @@ import { ACTIONS } from './common/feed';
|
||||
const TIMEOUT_BASE = (1000 * 5) as Types.Milliseconds; // 5 seconds
|
||||
const TIMEOUT_MAX = (1000 * 60 * 5) as Types.Milliseconds; // 5 minutes
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
process_env: string;
|
||||
}
|
||||
}
|
||||
|
||||
export class Connection {
|
||||
public static async create(
|
||||
pins: PersistentSet<Types.NodeName>,
|
||||
@@ -26,11 +32,25 @@ export class Connection {
|
||||
}
|
||||
|
||||
private static readonly utf8decoder = new TextDecoder('utf-8');
|
||||
private static readonly address = Connection.getAddress();
|
||||
|
||||
private static readonly address =
|
||||
window.location.protocol === 'https:'
|
||||
? `wss://${window.location.hostname}/feed/`
|
||||
: `ws://127.0.0.1:8000/feed`;
|
||||
private static getAddress(): string {
|
||||
const ENV_URL = 'SUBSTRATE_TELEMETRY_URL';
|
||||
|
||||
if (process.env && process.env[ENV_URL]) {
|
||||
return process.env[ENV_URL] as string;
|
||||
}
|
||||
|
||||
if (window.process_env && window.process_env[ENV_URL]) {
|
||||
return window.process_env[ENV_URL];
|
||||
}
|
||||
|
||||
if (window.location.protocol === 'https:') {
|
||||
return `wss://${window.location.hostname}/feed/`;
|
||||
}
|
||||
|
||||
return `ws://127.0.0.1:8000/feed`;
|
||||
}
|
||||
|
||||
private static async socket(): Promise<WebSocket> {
|
||||
let socket = await Connection.trySocket();
|
||||
@@ -63,7 +83,6 @@ export class Connection {
|
||||
clean();
|
||||
resolve(null);
|
||||
}
|
||||
|
||||
const socket = new WebSocket(Connection.address);
|
||||
|
||||
socket.binaryType = 'arraybuffer';
|
||||
@@ -82,7 +101,6 @@ export class Connection {
|
||||
private state: Readonly<State>;
|
||||
private readonly update: Update;
|
||||
private readonly pins: PersistentSet<Types.NodeName>;
|
||||
|
||||
constructor(
|
||||
socket: WebSocket,
|
||||
update: Update,
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.Consensus .flexContainerLargeRow .firstInRow .emptylegend,
|
||||
.Consensus .flexContainerLargeRow .firstInRow .emptyLegend,
|
||||
.Consensus .flexContainerLargeRow .firstInRow .nameLegend {
|
||||
width: 99%;
|
||||
flex-grow: 1000000000;
|
||||
@@ -134,7 +134,7 @@
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
.Consensus .flexContainerLargeRow .noStretchOnLastRow .firstInRow .emptylegend {
|
||||
.Consensus .flexContainerLargeRow .noStretchOnLastRow .firstInRow .emptyLegend {
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,325 +0,0 @@
|
||||
import * as Enzyme from './enzyme';
|
||||
const { shallow, mount } = Enzyme;
|
||||
|
||||
import { Server } from 'mock-socket';
|
||||
|
||||
import { Types, FeedMessage, timestamp, VERSION, SortedCollection } from '../../common';
|
||||
|
||||
import { Node, Update, State } from '../src/state';
|
||||
import { Connection } from '../src/Connection';
|
||||
import { PersistentObject, PersistentSet } from '../src/persist';
|
||||
|
||||
const { Actions } = FeedMessage;
|
||||
|
||||
describe('Connection.ts', () => {
|
||||
const fakeWebSocketURL = 'ws://localhost:8080';
|
||||
const mockServer = new Server(fakeWebSocketURL);
|
||||
|
||||
mockServer.on('connection', (socket: any) => {
|
||||
console.log('Got connection!');
|
||||
|
||||
// socket.on('message', (message: any) => {
|
||||
// console.log('message received by web socket -> ', message);
|
||||
// });
|
||||
//
|
||||
// socket.send('[0,15,8,["BBQ Birch",6],8,["Pistachios",57]]');
|
||||
});
|
||||
|
||||
let state: State;
|
||||
let connection: Connection;
|
||||
let handleMessages: any;
|
||||
let update: any;
|
||||
|
||||
const settings: State.Settings = {
|
||||
location: false,
|
||||
validator: false,
|
||||
implementation: false,
|
||||
peers: false,
|
||||
txs: false,
|
||||
cpu: false,
|
||||
mem: false,
|
||||
blocknumber: false,
|
||||
blockhash: false,
|
||||
blocktime: false,
|
||||
blockpropagation: false,
|
||||
blocklasttime: false
|
||||
}
|
||||
|
||||
beforeAll(async () => {
|
||||
state = {
|
||||
status: 'offline',
|
||||
best: 0 as Types.BlockNumber,
|
||||
blockTimestamp: 0 as Types.Timestamp,
|
||||
blockAverage: null,
|
||||
timeDiff: 0 as Types.Milliseconds,
|
||||
subscribed: null,
|
||||
chains: new Map(),
|
||||
nodes: new SortedCollection(Node.compare),
|
||||
settings,
|
||||
pins: new Set()
|
||||
} as State;
|
||||
|
||||
const pins: PersistentSet<Types.NodeName> = new PersistentSet<Types.NodeName>('key', ((p) => {}));
|
||||
|
||||
update = jest.fn((changes) => {
|
||||
// console.log('message passed to the update function -> ', changes);
|
||||
|
||||
state = Object.assign({}, state, changes);
|
||||
|
||||
// stub update function
|
||||
return state as Readonly<State>;
|
||||
}) as Update;
|
||||
|
||||
connection = await Connection.create(pins, update);
|
||||
|
||||
const before = connection.handleMessages;
|
||||
|
||||
connection.handleMessages = jest.fn(connection.handleMessages);
|
||||
|
||||
// console.log('handle after', connection.handleMessages === handleMessages, connection.handleMessages === before);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// clear stubs and fakes after each test case
|
||||
// connection.handleMessages.restore();
|
||||
})
|
||||
|
||||
test('handle Feed Version message state update', async () => {
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.FeedVersion,
|
||||
payload: VERSION
|
||||
}
|
||||
] as any as FeedMessage.Message[])
|
||||
|
||||
expect(update).toHaveBeenCalled();
|
||||
expect(state.status).toBe('online');
|
||||
})
|
||||
|
||||
test('handle Best Block message state update', () => {
|
||||
const time = timestamp();
|
||||
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.BestBlock,
|
||||
payload: [1, time, 0],
|
||||
}, {
|
||||
action: Actions.BestBlock,
|
||||
payload: [1, time, 123456789]
|
||||
}
|
||||
] as any as FeedMessage.Message[]);
|
||||
|
||||
expect(update).toHaveBeenCalled();
|
||||
expect(state.blockTimestamp).toBe(time);
|
||||
expect(state.blockAverage).toBe(123456789);
|
||||
})
|
||||
|
||||
describe('Add and Remove a Node', () => {
|
||||
const time = timestamp();
|
||||
|
||||
test('handle Added Node message state update', () => {
|
||||
/*
|
||||
Added Node Message (NodeId, NodeDetails, NodeStats, BlockDetails, Maybe<NodeLocation>)
|
||||
*/
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.AddedNode,
|
||||
payload: [1, ['Sample Node', 'Sampling', '1.2.3', '0x123456789012345'], [12, 84], [[38], [78], [5]], [1, 'aoaiuhsf9o2ih389r', 777, time, 829]],
|
||||
}
|
||||
] as any as FeedMessage.Message[]);
|
||||
|
||||
expect(update).toHaveBeenCalled();
|
||||
expect(state.status).toBe('online');
|
||||
expect(state.nodes).toBeDefined();
|
||||
|
||||
const firstNode = state.nodes.sorted()[0];
|
||||
|
||||
expect(firstNode.id).toBe(1);
|
||||
expect(firstNode.name).toBe('Sample Node');
|
||||
expect(firstNode.implementation).toBe('Sampling');
|
||||
expect(firstNode.validator).toBe('0x123456789012345');
|
||||
expect(firstNode.peers).toBe(12);
|
||||
expect(firstNode.txs).toBe(84);
|
||||
expect(firstNode.mem).toEqual([38]);
|
||||
expect(firstNode.cpu).toEqual([78]);
|
||||
expect(firstNode.height).toBe(1);
|
||||
expect(firstNode.hash).toBe('aoaiuhsf9o2ih389r');
|
||||
expect(firstNode.blockTime).toBe(777);
|
||||
expect(firstNode.blockTimestamp).toBe(time);
|
||||
expect(firstNode.propagationTime).toBe(829);
|
||||
})
|
||||
|
||||
test('handle Located Node message state update', () => {
|
||||
|
||||
/*
|
||||
Located Node
|
||||
[NodeId, Latitude, Longitude, City]
|
||||
*/
|
||||
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.LocatedNode,
|
||||
payload: [1, 30.828, 101.4111, 'Kuala Lumpur']
|
||||
}
|
||||
] as any as FeedMessage.Message[]);
|
||||
|
||||
expect(update).toHaveBeenCalled();
|
||||
|
||||
const firstNode = state.nodes.sorted()[0];
|
||||
|
||||
expect(firstNode.lat).toEqual(30.828)
|
||||
expect(firstNode.lon).toEqual(101.4111)
|
||||
expect(firstNode.city).toEqual('Kuala Lumpur')
|
||||
});
|
||||
|
||||
test('handle Time Sync message state update', () => {
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.TimeSync,
|
||||
payload: time + 12345432
|
||||
}
|
||||
] as any as FeedMessage.Message[]);
|
||||
|
||||
const firstNode = state.nodes.sorted()[0];
|
||||
|
||||
expect(firstNode.blockTimestamp).toBe(time);
|
||||
})
|
||||
|
||||
test('handle Imported Block message state update', () => {
|
||||
/*
|
||||
ImportedBlockMessage [NodeId, BlockDetails]
|
||||
BlockDetails = [BlockNumber, BlockHash, Milliseconds, Timestamp, Maybe<PropagationTime>]
|
||||
*/
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.ImportedBlock,
|
||||
payload: ["BBQ Birch", [1, 'ABCDEFGH12345678', 123, time, 48292010]],
|
||||
}
|
||||
] as any as FeedMessage.Message[]);
|
||||
|
||||
const firstSortedNode = state.nodes.sorted()[0];
|
||||
|
||||
expect(firstSortedNode.pinned).toBeFalsy();
|
||||
expect(firstSortedNode).toMatchObject({
|
||||
pinned: false,
|
||||
id: 1,
|
||||
name: 'Sample Node',
|
||||
implementation: 'Sampling',
|
||||
version: '1.2.3',
|
||||
validator: '0x123456789012345',
|
||||
peers: 12,
|
||||
txs: 84,
|
||||
mem: [38],
|
||||
cpu: [78],
|
||||
height: 1,
|
||||
hash: 'aoaiuhsf9o2ih389r',
|
||||
blockTime: 777,
|
||||
blockTimestamp: time,
|
||||
propagationTime: 829,
|
||||
lat: 30.828,
|
||||
lon: 101.4111,
|
||||
city: 'Kuala Lumpur'
|
||||
});
|
||||
});
|
||||
|
||||
test('handle Removed Node message state update', () => {
|
||||
/*
|
||||
payload: 1
|
||||
*/
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.RemovedNode,
|
||||
payload: 1
|
||||
}
|
||||
] as any as FeedMessage.Message[]);
|
||||
|
||||
expect(update).toHaveBeenCalled();
|
||||
expect(state.nodes.sorted()).toEqual([]);
|
||||
})
|
||||
})
|
||||
|
||||
describe('Add and Remove a Chain', () => {
|
||||
test('handle Added Chain message state update', () => {
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.AddedChain,
|
||||
payload: ["BBQ Birch", 6],
|
||||
}, {
|
||||
action: Actions.AddedChain,
|
||||
payload: ["Krumme Lanke", 57]
|
||||
}
|
||||
] as any as FeedMessage.Message[]);
|
||||
|
||||
expect(update).toHaveBeenCalled();
|
||||
|
||||
const chains = [];
|
||||
|
||||
for (const chain of state.chains) {
|
||||
chains.push(chain);
|
||||
}
|
||||
|
||||
const firstChain = chains[0];
|
||||
const secondChain = chains[1];
|
||||
|
||||
expect(chains).toHaveLength(2);
|
||||
expect(firstChain).toEqual([ 'BBQ Birch', 6 ]);
|
||||
expect(secondChain).toEqual([ 'Krumme Lanke', 57 ]);
|
||||
});
|
||||
|
||||
test('handle Node Stats message state update', () => {
|
||||
|
||||
})
|
||||
|
||||
|
||||
describe('Subscribe and Unsubscribe to Message', () => {
|
||||
test('handle Subscribed To message state update', () => {
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.SubscribedTo,
|
||||
payload: 'BBQ Birch'
|
||||
}
|
||||
] as any as FeedMessage.Message[]);
|
||||
|
||||
expect(update).toHaveBeenCalled();
|
||||
expect(state.subscribed).toBe('BBQ Birch');
|
||||
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.SubscribedTo,
|
||||
payload: 'Krumme Lanke'
|
||||
}
|
||||
] as any as FeedMessage.Message[]);
|
||||
|
||||
expect(update).toHaveBeenCalled();
|
||||
expect(state.subscribed).toBe('Krumme Lanke');
|
||||
});
|
||||
|
||||
test('handle Unsubscribed From message state update', () => {
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.UnsubscribedFrom,
|
||||
payload: 'Krumme Lanke'
|
||||
}
|
||||
] as any as FeedMessage.Message[]);
|
||||
|
||||
expect(update).toHaveBeenCalled();
|
||||
expect(state.subscribed).toBeFalsy();
|
||||
})
|
||||
})
|
||||
|
||||
test('handle Removed Chain message state update', () => {
|
||||
connection.handleMessages([
|
||||
{
|
||||
action: Actions.RemovedChain,
|
||||
payload: 'BBQ Birch'
|
||||
}, {
|
||||
action: Actions.RemovedChain,
|
||||
payload: 'Krumme Lanke'
|
||||
}
|
||||
] as any as FeedMessage.Message[]);
|
||||
|
||||
expect(update).toHaveBeenCalled();
|
||||
expect(state.chains.keys()).toMatchObject({});
|
||||
})
|
||||
})
|
||||
});
|
||||
@@ -1,13 +1,11 @@
|
||||
const test = require('tape');
|
||||
const common = require('../build/common');
|
||||
|
||||
import * as test from 'tape';
|
||||
import { sortedInsert, sortedIndexOf } from '../src/common';
|
||||
test('sortedInsert', (assert) => {
|
||||
const { sortedInsert } = common;
|
||||
const cmp = (a, b) => a - b;
|
||||
const cmp = (a: number, b: number) => a - b;
|
||||
|
||||
let mod = sortedInsert(3, [1, 2, 4, 5], cmp);
|
||||
let _mod = sortedInsert(3, [1, 2, 4, 5], cmp);
|
||||
|
||||
function assertInsert(item, into, equals) {
|
||||
function assertInsert(item: number, into: number[], equals: number[]) {
|
||||
sortedInsert(item, into, cmp);
|
||||
assert.same(into, equals, `Inserts ${item}`);
|
||||
}
|
||||
@@ -26,14 +24,13 @@ test('sortedInsert', (assert) => {
|
||||
});
|
||||
|
||||
test('sortedInsert fuzz', (assert) => {
|
||||
const { sortedInsert } = common;
|
||||
const cmp = (a, b) => a - b;
|
||||
const cmp = (a: number, b: number) => a - b;
|
||||
const scramble = () => Math.random() - 0.5;
|
||||
const sorted = [1, 2, 3, 4, 5, 6, 7, 8, 9];
|
||||
|
||||
for (let i = 0; i < 50; i++) {
|
||||
const scrambled = sorted.sort(scramble);
|
||||
const resorted = [];
|
||||
const resorted: number[] = [];
|
||||
|
||||
for (const item of scrambled) {
|
||||
sortedInsert(item, resorted, cmp);
|
||||
@@ -46,9 +43,8 @@ test('sortedInsert fuzz', (assert) => {
|
||||
});
|
||||
|
||||
test('sortedInsert indexes', (assert) => {
|
||||
const { sortedInsert } = common;
|
||||
const cmp = (a, b) => a - b;
|
||||
const into = [];
|
||||
const cmp = (a: number, b: number) => a - b;
|
||||
const into:number[] = [];
|
||||
|
||||
assert.equals(sortedInsert(5, into, cmp), 0, 'Insert 5');
|
||||
assert.same(into, [5], 'Elements check out');
|
||||
@@ -72,21 +68,27 @@ test('sortedInsert indexes', (assert) => {
|
||||
assert.end();
|
||||
});
|
||||
|
||||
type ValueObj = {
|
||||
value: number;
|
||||
};
|
||||
|
||||
test('sortedIndexOf', (assert) => {
|
||||
const { sortedIndexOf } = common;
|
||||
const cmp = (a, b) => a.value - b.value;
|
||||
const array = [];
|
||||
const cmp = (a: ValueObj, b: ValueObj) => a.value - b.value;
|
||||
const array: Array<ValueObj> = [];
|
||||
|
||||
for (let i = 1; i <= 1000; i++) {
|
||||
array.push({ value: i >> 1 });
|
||||
}
|
||||
|
||||
for (let i = 0; i < 50; i++) {
|
||||
let index = Math.random() * 1000 | 0;
|
||||
let index = (Math.random() * 1000) | 0;
|
||||
const item = array[index];
|
||||
|
||||
item = array[index];
|
||||
|
||||
assert.equals(sortedIndexOf(item, array, cmp), array.indexOf(item), `Correct for ${item.value}`);
|
||||
assert.equals(
|
||||
sortedIndexOf(item, array, cmp),
|
||||
array.indexOf(item),
|
||||
`Correct for ${item.value}`
|
||||
);
|
||||
}
|
||||
|
||||
assert.end();
|
||||
@@ -1,12 +0,0 @@
|
||||
// Copyright 2017-2018 @polkadot authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the ISC license. See the LICENSE file for details.
|
||||
|
||||
const Adapter = require('enzyme-adapter-react-16');
|
||||
const Enzyme = require('enzyme');
|
||||
|
||||
Enzyme.configure({
|
||||
adapter: new Adapter()
|
||||
});
|
||||
|
||||
module.exports = Enzyme;
|
||||
@@ -13,7 +13,7 @@
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"noEmitOnError": false,
|
||||
"pretty": true,
|
||||
"forceConsistentCasingInFileNames": false,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noErrorTruncation": true,
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitAny": true,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.json"
|
||||
}
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs"
|
||||
}
|
||||
}
|
||||
|
||||
+2476
-1026
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user