Skip to content

Commit 36cf18a

Browse files
committed
FEATURE EXTPLESK-9225 Update Jest configuration
1 parent 1b4fb46 commit 36cf18a

File tree

21 files changed

+85
-126
lines changed

21 files changed

+85
-126
lines changed

jest.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
2+
3+
/** @type {import('jest').Config} */
4+
const config = {
5+
testMatch: [
6+
'**/*.test.js?(x)',
7+
],
8+
setupFiles: [
9+
'<rootDir>/test/setup.js',
10+
],
11+
snapshotSerializers: [
12+
'enzyme-to-json/serializer',
13+
],
14+
};
15+
16+
module.exports = config;

lib/templates/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render, createElement } from '@plesk/ui-library';
1+
import { render } from '@plesk/ui-library';
22
import App from '../../src/App';
33
import routes from 'routes';
44

package.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,14 @@
5151
"yargs": "^18.0.0"
5252
},
5353
"devDependencies": {
54+
"@zarconontol/enzyme-adapter-react-18": "^0.7.3",
5455
"cheerio": "^1.1.2",
5556
"enzyme": "^3.11.0",
56-
"enzyme-adapter-react-16": "^1.15.8",
5757
"enzyme-to-json": "^3.6.2",
5858
"remark-cli": "^12.0.1",
5959
"remark-validate-links": "^13.1.0"
6060
},
61-
"jest": {
62-
"testMatch": [
63-
"**/*.test.js?(x)"
64-
],
65-
"setupFiles": [
66-
"<rootDir>/test/setup.js"
67-
],
68-
"snapshotSerializers": [
69-
"enzyme-to-json/serializer"
70-
]
61+
"resolutions": {
62+
"cheerio": "1.0.0-rc.12"
7163
}
7264
}

src/Api/__tests__/withApi.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.
22

3-
import { createElement } from '@plesk/ui-library';
43
import { mount } from 'enzyme';
54
import withApi from '../withApi';
65

src/Api/withApi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.
22

3-
import { createElement, PropTypes } from '@plesk/ui-library';
3+
import { PropTypes } from '@plesk/ui-library';
44

55
const withApi = Component => {
66
const C = (props, context) => (

src/App/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.
22

3-
import { createElement, LocaleProvider, PropTypes } from '@plesk/ui-library';
3+
import { LocaleProvider, PropTypes } from '@plesk/ui-library';
44
import { BrowserRouter, Switch, Route } from 'react-router-dom';
55
import { ConfigProvider } from '../Config';
66
import { ApiProvider } from '../Api';

src/App/__tests__/App.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.
22

3-
import { createElement } from '@plesk/ui-library';
43
import App from '../App';
54
import { ConfigProvider } from '../../Config';
65
import { ApiProvider } from '../../Api';

src/Config/__tests__/withConfig.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.
22

3-
import { createElement } from '@plesk/ui-library';
43
import withConfig from '../withConfig';
54
import { mount } from 'enzyme';
65

src/Config/withConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.
22

3-
import { createElement, PropTypes } from '@plesk/ui-library';
3+
import { PropTypes } from '@plesk/ui-library';
44

55
const withConfig = Component => {
66
const C = (props, context) => (

src/Page/Page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.
22

3-
import { createElement, createPortal, Component, Fragment, PropTypes } from '@plesk/ui-library';
3+
import { createPortal, Component, Fragment, PropTypes } from '@plesk/ui-library';
44
import { Link } from 'react-router-dom';
55

66
const stripTags = str => (str || '').replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?(\/)?>|<\/\w+>/gi, '');

0 commit comments

Comments
 (0)