Skip to content

Commit

Permalink
Merge branch 'master' into rudderstack-integration-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienne-deriv committed Jun 30, 2023
2 parents bca879e + 5665166 commit 0746185
Show file tree
Hide file tree
Showing 214 changed files with 5,892 additions and 5,397 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
pull_request:
branches:
- '**'
env:
JEST_MAX_WORKERS: 4
push:
branches:
- master
Expand All @@ -21,7 +23,7 @@ jobs:
npm install
npm run bootstrap
npm run build:all
npm run test:jest 4
npm run test:jest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"start": "f () { lerna exec --scope=@deriv/${1:-'*'} -- npm run start ;}; f",
"test": "f () { bash ./scripts/circleci-config.test.sh && npm run test:stylelint && npm run test:eslint-all && npm run test:jest ;}; f",
"test:stylelint": "stylelint \"./packages/*/src/**/*.s(a|c)ss\"",
"test:jest": "jest --all --maxWorkers=${1:-8}",
"test:jest": "jest --all --maxWorkers=${JEST_MAX_WORKERS:-'45%'}",
"test:e2e": "cd end-to-end-test && npx playwright test",
"test:e2e-dev": "cd end-to-end-test && npx playwright test --trace on && npx playwright show-report",
"test:performance": "cd e2e_tests && jest -c ./jest.config.js --maxWorkers=2 --detectOpenHandles performance",
Expand Down
1 change: 0 additions & 1 deletion packages/account/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module.exports = function (env) {
'api-token': 'Components/api-token',
'currency-selector': 'Components/currency-selector',
'currency-selector-config': 'Configs/currency-selector-config',
'currency-selector-schema': 'Configs/currency-selector-schema',
'currency-radio-button-group': 'Components/currency-selector/radio-button-group.tsx',
'currency-radio-button': 'Components/currency-selector/radio-button.tsx',
'demo-message': 'Components/demo-message',
Expand Down
1 change: 0 additions & 1 deletion packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@deriv/api-types": "^1.0.94",
"@deriv/components": "^1.0.0",
"@deriv/shared": "^1.0.0",
"@deriv/stores":"^1.0.0",
"@deriv/translations": "^1.0.0",
"bowser": "^2.9.0",
"classnames": "^2.2.6",
Expand Down
16 changes: 8 additions & 8 deletions packages/account/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import React from 'react';
import Routes from './Containers/routes';
import ResetTradingPassword from './Containers/reset-trading-password';
import { setWebsocket } from '@deriv/shared';
import { StoreProvider } from '@deriv/stores';
import { TCoreStores } from '@deriv/stores/types';
import { MobxContentProvider } from './Stores/connect';
import initStore from './Stores/init-store';
import TCoreStore from './Stores/index';

// TODO: add correct types for WS after implementing them
// TODO: add correct types for stores and WS after implementing them
type TAppProps = {
passthrough: {
root_store: TCoreStores;
root_store: TCoreStore;
WS: Record<string, any>;
};
};

const App = ({ passthrough }: TAppProps) => {
const { root_store, WS } = passthrough;
setWebsocket(WS);
initStore(root_store, WS);

return (
<StoreProvider store={root_store}>
<MobxContentProvider store={root_store}>
<Routes />
<ResetTradingPassword />
</StoreProvider>
</MobxContentProvider>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import { PlatformContext } from '@deriv/shared';
import { findRouteByPath } from '../helpers';
import BinaryLink from '../binary-link';

jest.mock('Stores/connect', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

jest.mock('../helpers', () => ({
findRouteByPath: jest.fn(() => '/test/path'),
normalizePath: jest.fn(() => '/test/path'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { render, screen } from '@testing-library/react';
import { PlatformContext } from '@deriv/shared';
import BinaryRoutes from '../binary-routes';

jest.mock('Stores/connect', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

jest.mock('../route-with-sub-routes', () => jest.fn(() => <div>RouteWithSubRoutes</div>));

jest.mock('Constants/routes-config', () => () => [{}]);
Expand Down
Loading

0 comments on commit 0746185

Please sign in to comment.