From e0bfcab869a7a7aba06ef6bf423f6e0dd90c526b Mon Sep 17 00:00:00 2001 From: zombieJ Date: Mon, 17 Jun 2019 12:00:52 +0800 Subject: [PATCH] chore: Fix react-dnd CI (#17130) * adjust jest ignore * add node test * update es --- .jest.js | 2 +- .jest.node.js | 3 +++ components/tabs/demo/custom-tab-bar-node.md | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.jest.js b/.jest.js index 50517f9d0d..cc38788c90 100644 --- a/.jest.js +++ b/.jest.js @@ -2,7 +2,7 @@ const libDir = process.env.LIB_DIR; const transformIgnorePatterns = [ '/dist/', - 'node_modules/[^/]+?/(?!(es|node_modules)/)', // Ignore modules without es dir + 'node_modules/(?!(_react-dnd|react-dnd|_dnd-core|dnd-core))[^/]+?/(?!(es|node_modules)/)', // Ignore modules without es dir ]; module.exports = { diff --git a/.jest.node.js b/.jest.node.js index 7ba89e4b0e..64dd63e8df 100644 --- a/.jest.node.js +++ b/.jest.node.js @@ -1,3 +1,5 @@ +const { transformIgnorePatterns } = require('./.jest'); + // jest config for server render environment module.exports = { setupFiles: ['./tests/setup.js'], @@ -10,6 +12,7 @@ module.exports = { }, testRegex: 'demo\\.test\\.js$', testEnvironment: 'node', + transformIgnorePatterns, snapshotSerializers: ['enzyme-to-json/serializer'], globals: { 'ts-jest': { diff --git a/components/tabs/demo/custom-tab-bar-node.md b/components/tabs/demo/custom-tab-bar-node.md index 0afca5bb6d..e4a6aa4ea1 100644 --- a/components/tabs/demo/custom-tab-bar-node.md +++ b/components/tabs/demo/custom-tab-bar-node.md @@ -15,7 +15,7 @@ Use `react-dnd` to make tabs draggable. ```jsx import { Tabs } from 'antd'; -import { DragDropContextProvider, DragSource, DropTarget } from 'react-dnd'; +import { DndProvider, DragSource, DropTarget } from 'react-dnd'; import HTML5Backend from 'react-dnd-html5-backend'; const { TabPane } = Tabs; @@ -127,11 +127,11 @@ class DraggableTabs extends React.Component { }); return ( - + {orderTabs} - + ); } }