From b4cacf6bc21baba92f529707977d5933f92779f1 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 10 Feb 2020 15:25:44 +0200 Subject: [PATCH 1/3] Fix wallaby --- lib/src/commands/OptionsProcessor.test.ts | 6 ++++- lib/src/components/ComponentWrapper.tsx | 2 +- package.json | 16 +++++++------ wallaby.js | 28 ----------------------- 4 files changed, 15 insertions(+), 37 deletions(-) diff --git a/lib/src/commands/OptionsProcessor.test.ts b/lib/src/commands/OptionsProcessor.test.ts index 67c6910e277..c02ebbfe5ba 100644 --- a/lib/src/commands/OptionsProcessor.test.ts +++ b/lib/src/commands/OptionsProcessor.test.ts @@ -6,6 +6,10 @@ import { mock, when, anyString, instance, anyNumber, verify } from 'ts-mockito'; import { ColorService } from '../adapters/ColorService'; import { AssetService } from '../adapters/AssetResolver'; +jest.mock('lodash/uniqueId', () => { + return (prefix: string) => `${prefix}1` +}) + describe('navigation options', () => { let uut: OptionsProcessor; const mockedStore = mock(Store) as Store; @@ -86,7 +90,7 @@ describe('navigation options', () => { const options = { topBar: { title: { component: { name: 'a' } } } }; uut.processOptions(options); - + console.log(options) expect(options).toEqual({ topBar: { title: { component: { name: 'a', componentId: 'CustomComponent1' } } }, }); diff --git a/lib/src/components/ComponentWrapper.tsx b/lib/src/components/ComponentWrapper.tsx index 9948a1bcd4e..be14c750633 100644 --- a/lib/src/components/ComponentWrapper.tsx +++ b/lib/src/components/ComponentWrapper.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { ComponentProvider } from 'react-native'; import merge from 'lodash/merge' import { polyfill } from 'react-lifecycles-compat'; -import hoistNonReactStatics = require('hoist-non-react-statics'); +import hoistNonReactStatics from 'hoist-non-react-statics'; import { Store } from './Store'; import { ComponentEventsObserver } from '../events/ComponentEventsObserver'; diff --git a/package.json b/package.json index a8374111a4c..e6c613ec117 100644 --- a/package.json +++ b/package.json @@ -98,17 +98,19 @@ }, "roots": [ "/node_modules/", - "/lib/dist/", + "/lib/src/", "/integration/" ], "collectCoverageFrom": [ - "lib/dist/**/*.js", + "!lib/src/**/*.js", "integration/**/*.js", - "!lib/dist/index.js", - "!lib/dist/Navigation.js", - "!lib/dist/adapters/**/*", - "!lib/dist/interfaces/**/*", - "!lib/dist/**/*.test.*", + "lib/src/**/*.ts", + "!lib/src/index.ts", + "!lib/src/types.ts", + "!lib/src/Navigation.ts", + "!lib/src/adapters/**/*", + "!lib/src/interfaces/**/*", + "!lib/src/**/*.test.*", "!integration/**/*.test.*", "!integration/*.test.*" ], diff --git a/wallaby.js b/wallaby.js index 4b1cf03b00b..ac3ab1edaae 100644 --- a/wallaby.js +++ b/wallaby.js @@ -8,34 +8,6 @@ module.exports = function (wallaby) { }, testFramework: 'jest', - - files: [ - 'package.json', - 'lib/src/**/*.js', - 'lib/src/**/*.ts', - 'lib/src/**/*.tsx', - '!lib/src/**/*.test.tsx', - '!lib/src/**/*.test.js', - '!lib/src/**/*.test.ts', - 'integration/**/*.js', - '!integration/**/*.test.js' - ], - - tests: [ - 'lib/src/**/*.test.js', - 'lib/src/**/*.test.ts', - 'lib/src/**/*.test.tsx', - 'integration/**/*.test.js' - ], - - compilers: { - '**/*.js': wallaby.compilers.babel(babelOptions), - '**/*.ts?(x)': wallaby.compilers.typeScript({ - module: 'commonjs', - jsx: 'React' - }) - }, - setup: (w) => { w.testFramework.configure(require('./package.json').jest); } From 44989117e968db81cfaff5e3b54a1eb36f4a3b0c Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 10 Feb 2020 15:27:20 +0200 Subject: [PATCH 2/3] Add coverage on tsx files --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index e6c613ec117..e9502e28fee 100644 --- a/package.json +++ b/package.json @@ -105,6 +105,7 @@ "!lib/src/**/*.js", "integration/**/*.js", "lib/src/**/*.ts", + "lib/src/**/*.tsx", "!lib/src/index.ts", "!lib/src/types.ts", "!lib/src/Navigation.ts", From 22979b0b7de1f08a8dfab3389e2b08ee62dc3824 Mon Sep 17 00:00:00 2001 From: Guy Carmeli Date: Mon, 10 Feb 2020 16:05:06 +0200 Subject: [PATCH 3/3] Update lib/src/commands/OptionsProcessor.test.ts --- lib/src/commands/OptionsProcessor.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/src/commands/OptionsProcessor.test.ts b/lib/src/commands/OptionsProcessor.test.ts index c02ebbfe5ba..0be108143fc 100644 --- a/lib/src/commands/OptionsProcessor.test.ts +++ b/lib/src/commands/OptionsProcessor.test.ts @@ -90,7 +90,6 @@ describe('navigation options', () => { const options = { topBar: { title: { component: { name: 'a' } } } }; uut.processOptions(options); - console.log(options) expect(options).toEqual({ topBar: { title: { component: { name: 'a', componentId: 'CustomComponent1' } } }, });