Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit 817e371

Browse files
yangshunfacebook-github-bot
authored andcommitted
Remove Jest auto mocking (#2279)
Summary: **Summary** Saw that the Travis CI is failing because of a new test (`isHTMLBRElement`) which did not explicitly disable auto mocking. In Sandcastle, Jest tests aren't automocked hence the tests passed internally but is failing on GitHub. Since all the tests in the repo have `jest.disableAutomock()`, there's no value in having `automock: true` within `package.json`, we can remove it and save ourselves of this config discrepancy and further pain in future. If we decide to go with this approach then #2278 can be abandoned/closed. **Test Plan** Travis CI should pass. Also check that Sandcastle passes. Pull Request resolved: #2279 Reviewed By: mrkev Differential Revision: D18874249 Pulled By: yangshun fbshipit-source-id: e371558552728b395f67bf1c4d94b127cc3c2c96
1 parent 0603772 commit 817e371

File tree

59 files changed

+2
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2
-111
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
"npm": "2.x || 3.x || 5.x || 6.x"
8888
},
8989
"jest": {
90-
"automock": true,
9190
"globals": {
9291
"__DEV__": true
9392
},

src/component/base/__tests__/DraftEditor.react-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
'use strict';
1212

13-
jest.disableAutomock();
14-
1513
jest.mock('generateRandomKey');
1614

1715
const DraftEditor = require('DraftEditor.react');

src/component/contents/__tests__/DraftEditorBlock.react-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
'use strict';
1212

1313
jest
14-
.disableAutomock()
1514
.mock('Style')
1615
.mock('getElementPosition')
1716
.mock('getScrollPosition')

src/component/contents/__tests__/DraftEditorContents.react-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
'use strict';
1212

13-
jest.disableAutomock();
14-
1513
jest.mock('generateRandomKey');
1614

1715
const Editor = require('DraftEditor.react');

src/component/contents/__tests__/DraftEditorTextNode-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
'use strict';
1313

14-
jest.disableAutomock().mock('UserAgent');
14+
jest.mock('UserAgent');
1515

1616
const BLOCK_DELIMITER_CHAR = '\n';
1717
const TEST_A = 'Hello';

src/component/contents/exploration/__tests__/DraftEditorBlockNode.react-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
'use strict';
1212

1313
jest
14-
.disableAutomock()
1514
.mock('Style')
1615
.mock('getElementPosition')
1716
.mock('getScrollPosition')

src/component/contents/exploration/__tests__/DraftEditorContentsExperimental.react-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
'use strict';
1212

13-
jest.disableAutomock();
14-
1513
const ContentBlockNode = require('ContentBlockNode');
1614
const ContentState = require('ContentState');
1715
const DefaultDraftBlockRenderMap = require('DefaultDraftBlockRenderMap');

src/component/handlers/composition/__tests__/DraftEditorCompostionHandler-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
'use strict';
1313

14-
jest.disableAutomock();
15-
1614
// DraftEditorComposition uses timers to detect duplicate `compositionend`
1715
// events.
1816
jest.useFakeTimers();

src/component/handlers/edit/__tests__/editOnBeforeInput-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
'use strict';
1313

14-
jest.disableAutomock();
15-
1614
import type DraftEditor from 'DraftEditor.react';
1715

1816
const CompositeDraftDecorator = require('CompositeDraftDecorator');

src/component/handlers/edit/__tests__/editOnBlur-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
'use strict';
1313

14-
jest.disableAutomock();
15-
1614
const ContentBlock = require('ContentBlock');
1715
const ContentState = require('ContentState');
1816
const EditorState = require('EditorState');

0 commit comments

Comments
 (0)