fix test cases

This commit is contained in:
afc163 2019-11-05 00:19:02 +08:00 committed by 偏右
parent 725f2fb731
commit c083d13fc4
6 changed files with 11 additions and 2 deletions

View File

@ -84,6 +84,8 @@ const eslintrc = {
'no-restricted-globals': 0,
'max-classes-per-file': 0,
'react/static-property-placement': 0,
'jest/no-test-callback': 0,
'jest/expect-expect': 0,
},
globals: {
gtag: true,

View File

@ -30,8 +30,12 @@ describe('react router', () => {
afterAll(() => {
jest.useRealTimers();
});
// https://github.com/airbnb/enzyme/issues/875
(process.env.REACT === '15' ? it.skip : it)('react router 4', () => {
it('react router 4', () => {
if (process.env.REACT === '15') {
return;
}
const Home = withRouter(props => {
const { location, history } = props;
const pathSnippets = location.pathname.split('/').filter(i => i);

View File

@ -232,6 +232,7 @@ describe('Typography', () => {
wrapper.find('TextArea').simulate('keyUp', { keyCode: KeyCode.ESC });
},
onChange => {
// eslint-disable-next-line
expect(onChange).not.toHaveBeenCalled();
},
);

View File

@ -157,7 +157,7 @@
"@types/shallowequal": "^1.1.1",
"@types/warning": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^2.0.0",
"@typescript-eslint/parser": "^2.6.0",
"@typescript-eslint/parser": "~2.4.0",
"antd-theme-generator": "^1.1.6",
"babel-eslint": "^10.0.1",
"babel-plugin-add-react-displayname": "^0.0.5",

View File

@ -1,6 +1,7 @@
import React from 'react';
import { mount } from 'enzyme';
// eslint-disable-next-line jest/no-export
export default function focusTest(Component) {
describe('focus and blur', () => {
beforeAll(() => {

View File

@ -1,6 +1,7 @@
import React from 'react';
import { mount } from 'enzyme';
// eslint-disable-next-line jest/no-export
export default function mountTest(Component) {
describe(`mount and unmount`, () => {
// https://github.com/ant-design/ant-design/pull/18441