mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 01:20:24 +03:00
Updated babel packages and extracted babel config
This commit is contained in:
parent
fc71c0f5c8
commit
31f1d5b530
5 changed files with 681 additions and 359 deletions
15
babel.config.js
Normal file
15
babel.config.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'react-app',
|
||||
{
|
||||
runtime: 'automatic',
|
||||
typescript: true,
|
||||
},
|
||||
],
|
||||
],
|
||||
plugins: [
|
||||
'@babel/plugin-proposal-optional-chaining',
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator',
|
||||
],
|
||||
};
|
993
package-lock.json
generated
993
package-lock.json
generated
File diff suppressed because it is too large
Load diff
23
package.json
23
package.json
|
@ -66,9 +66,9 @@
|
|||
"workbox-strategies": "^6.1.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.8",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.13.8",
|
||||
"@babel/core": "^7.17.5",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.16.7",
|
||||
"@shlinkio/eslint-config-js-coding-standard": "~1.2.2",
|
||||
"@stryker-mutator/core": "^5.4.1",
|
||||
"@stryker-mutator/jest-runner": "^5.4.1",
|
||||
|
@ -92,9 +92,8 @@
|
|||
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.5",
|
||||
"adm-zip": "^0.4.16",
|
||||
"autoprefixer": "^10.0.2",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"babel-jest": "^27.5.1",
|
||||
"babel-loader": "^8.2.1",
|
||||
"babel-loader": "^8.2.3",
|
||||
"babel-plugin-named-asset-import": "^0.3.7",
|
||||
"babel-preset-react-app": "^10.0.0",
|
||||
"babel-runtime": "^6.26.0",
|
||||
|
@ -147,20 +146,6 @@
|
|||
"whatwg-fetch": "^3.5.0",
|
||||
"workbox-webpack-plugin": "^6.1.5"
|
||||
},
|
||||
"babel": {
|
||||
"presets": [
|
||||
[
|
||||
"react-app",
|
||||
{
|
||||
"runtime": "automatic"
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-optional-chaining",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { shallow, ShallowWrapper } from 'enzyme';
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { Button, ModalHeader } from 'reactstrap';
|
||||
import { Button, FormGroup, ModalHeader } from 'reactstrap';
|
||||
import { ShlinkDomain } from '../../../src/api/types';
|
||||
import { EditDomainRedirectsModal } from '../../../src/domains/helpers/EditDomainRedirectsModal';
|
||||
import { InfoTooltip } from '../../../src/utils/InfoTooltip';
|
||||
|
@ -32,7 +32,7 @@ describe('<EditDomainRedirectsModal />', () => {
|
|||
});
|
||||
|
||||
it('expected amount of form groups and tooltips', () => {
|
||||
const formGroups = wrapper.find('FormGroup');
|
||||
const formGroups = wrapper.find(FormGroup);
|
||||
const tooltips = wrapper.find(InfoTooltip);
|
||||
|
||||
expect(formGroups).toHaveLength(3);
|
||||
|
@ -50,7 +50,7 @@ describe('<EditDomainRedirectsModal />', () => {
|
|||
});
|
||||
|
||||
it('saves expected values when form is submitted', () => {
|
||||
const formGroups = wrapper.find('FormGroup');
|
||||
const formGroups = wrapper.find(FormGroup);
|
||||
|
||||
expect(editDomainRedirects).not.toHaveBeenCalled();
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { shallow, ShallowWrapper } from 'enzyme';
|
||||
import { FormGroup } from 'reactstrap';
|
||||
import { ServerForm } from '../../../src/servers/helpers/ServerForm';
|
||||
|
||||
describe('<ServerForm />', () => {
|
||||
|
@ -13,7 +14,7 @@ describe('<ServerForm />', () => {
|
|||
afterEach(jest.resetAllMocks);
|
||||
|
||||
it('renders components', () => {
|
||||
expect(wrapper.find('FormGroup')).toHaveLength(3);
|
||||
expect(wrapper.find(FormGroup)).toHaveLength(3);
|
||||
expect(wrapper.find('span')).toHaveLength(1);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue