diff --git a/.eslintrc.js b/.eslintrc.js index 487c2881d2..26dd847473 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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, diff --git a/components/breadcrumb/__tests__/router.test.js b/components/breadcrumb/__tests__/router.test.js index 7ccd0e1728..86b8643b69 100644 --- a/components/breadcrumb/__tests__/router.test.js +++ b/components/breadcrumb/__tests__/router.test.js @@ -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); diff --git a/components/typography/__tests__/index.test.js b/components/typography/__tests__/index.test.js index 40b06491fc..0e18b733e3 100644 --- a/components/typography/__tests__/index.test.js +++ b/components/typography/__tests__/index.test.js @@ -232,6 +232,7 @@ describe('Typography', () => { wrapper.find('TextArea').simulate('keyUp', { keyCode: KeyCode.ESC }); }, onChange => { + // eslint-disable-next-line expect(onChange).not.toHaveBeenCalled(); }, ); diff --git a/package.json b/package.json index 23572e3317..3831e6301b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/tests/shared/focusTest.js b/tests/shared/focusTest.js index 4217225f03..db5db0fa53 100644 --- a/tests/shared/focusTest.js +++ b/tests/shared/focusTest.js @@ -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(() => { diff --git a/tests/shared/mountTest.js b/tests/shared/mountTest.js index 931db4c859..3793bfb7b4 100644 --- a/tests/shared/mountTest.js +++ b/tests/shared/mountTest.js @@ -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