Skip to content

Commit

Permalink
test: [JENKINS] fix jest config, fail with logs on coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinab25 committed Jan 4, 2024
1 parent 937a4e1 commit 12f799a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { jest } from '@jest/globals';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import config from '@plone/volto/registry';
import { blocksConfig } from '@plone/volto/config/Blocks';
import installSlate from '@plone/volto-slate/index';

var mockSemanticComponents = jest.requireActual('semantic-ui-react');
var mockComponents = jest.requireActual('@plone/volto/components');
var config = jest.requireActual('@plone/volto/registry').default;

config.blocks.blocksConfig = {
...blocksConfig,
...config.blocks.blocksConfig,
};

jest.doMock('semantic-ui-react', () => ({
__esModule: true,
Expand All @@ -29,14 +34,11 @@ jest.doMock('@plone/volto/components', () => {
};
});

const mockStore = configureStore([thunk]);

config.blocks.blocksConfig = {
...blocksConfig,
...config.blocks.blocksConfig,
};
jest.doMock('@plone/volto/registry', () =>
[installSlate].reduce((acc, apply) => apply(acc), config),
);

[installSlate].reduce((acc, apply) => apply(acc), config);
const mockStore = configureStore([thunk]);

global.fetch = jest.fn(() =>
Promise.resolve({
Expand Down

0 comments on commit 12f799a

Please sign in to comment.