From afd6166ed720a4911a3c81610043d0891c378938 Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Sat, 7 Dec 2019 00:38:54 -0800 Subject: [PATCH 1/2] Remove Jest auto mocking --- package.json | 1 - src/component/base/__tests__/DraftEditor.react-test.js | 2 -- src/component/contents/__tests__/DraftEditorBlock.react-test.js | 1 - .../contents/__tests__/DraftEditorContents.react-test.js | 2 -- src/component/contents/__tests__/DraftEditorTextNode-test.js | 2 +- .../exploration/__tests__/DraftEditorBlockNode.react-test.js | 1 - .../__tests__/DraftEditorContentsExperimental.react-test.js | 2 -- .../composition/__tests__/DraftEditorCompostionHandler-test.js | 2 -- src/component/handlers/edit/__tests__/editOnBeforeInput-test.js | 2 -- src/component/handlers/edit/__tests__/editOnBlur-test.js | 2 -- src/component/handlers/edit/__tests__/editOnInput-test.js | 2 -- .../handlers/edit/commands/__tests__/SecondaryClipboard-test.js | 2 -- .../edit/commands/__tests__/removeTextWithStrategy-test.js | 2 -- src/component/selection/__tests__/DraftOffsetKey-test.js | 2 -- .../selection/__tests__/getDraftEditorSelection-test.js | 2 -- .../utils/__tests__/getContentEditableContainer-test.js | 2 -- .../utils/exploration/__tests__/DraftTreeAdapter-test.js | 2 -- .../utils/exploration/__tests__/DraftTreeInvariants-test.js | 2 -- src/model/decorators/__tests__/CompositeDraftDecorator-test.js | 2 +- src/model/encoding/__tests__/DraftStringKey-test.js | 2 -- src/model/encoding/__tests__/convertFromDraftStateToRaw-test.js | 2 -- .../encoding/__tests__/convertFromHTMLToContentBlocks-test.js | 1 - src/model/encoding/__tests__/convertFromRawToDraftState-test.js | 2 -- src/model/encoding/__tests__/decodeEntityRanges-test.js | 2 -- src/model/encoding/__tests__/decodeInlineStyleRanges-test.js | 2 -- src/model/encoding/__tests__/encodeEntityRanges-test.js | 2 -- src/model/encoding/__tests__/encodeInlineStyleRanges-test.js | 2 -- src/model/encoding/__tests__/sanitizeDraftText-test.js | 2 -- src/model/entity/__tests__/DraftEntity-test.js | 2 -- src/model/entity/__tests__/getEntityKeyForSelection-test.js | 2 -- src/model/immutable/__tests__/BlockTree-test.js | 2 -- src/model/immutable/__tests__/CharacterMetadata-test.js | 2 -- src/model/immutable/__tests__/ContentBlock-test.js | 2 -- src/model/immutable/__tests__/ContentBlockNode-test.js | 2 -- src/model/immutable/__tests__/ContentState-test.js | 2 -- src/model/immutable/__tests__/EditorBidiService-test.js | 2 -- src/model/immutable/__tests__/EditorState-test.js | 2 -- src/model/immutable/__tests__/SelectionState-test.js | 2 -- src/model/immutable/__tests__/findRangesImmutable-test.js | 2 -- src/model/modifier/__tests__/AtomicBlockUtils-test.js | 2 -- src/model/modifier/__tests__/DraftRemovableWord-test.js | 1 - src/model/modifier/__tests__/RichTextEditorUtil-test.js | 2 -- .../modifier/exploration/__tests__/DraftTreeOperations-test.js | 2 -- .../exploration/__tests__/NestedRichTextEditorUtil-test.js | 2 -- src/model/paste/__tests__/DraftPasteProcessor-test.js | 2 -- src/model/transaction/__tests__/ContentStateInlineStyle-test.js | 2 -- .../transaction/__tests__/applyEntityToContentBlock-test.js | 2 -- .../transaction/__tests__/applyEntityToContentState-test.js | 2 -- src/model/transaction/__tests__/getContentStateFragment-test.js | 2 -- .../__tests__/insertFragmentIntoContentState-test.js | 2 -- src/model/transaction/__tests__/insertIntoList-test.js | 2 -- .../transaction/__tests__/insertTextIntoContentState-test.js | 2 -- src/model/transaction/__tests__/moveBlockInContentState-test.js | 2 -- src/model/transaction/__tests__/randomizeBlockMapKeys-test.js | 2 -- src/model/transaction/__tests__/removeEntitiesAtEdges-test.js | 2 -- .../transaction/__tests__/removeRangeFromContentState-test.js | 2 -- .../transaction/__tests__/splitBlockInContentState-test.js | 2 -- .../exploration/__tests__/getNextDelimiterBlockKey-test.js | 2 -- 58 files changed, 2 insertions(+), 109 deletions(-) diff --git a/package.json b/package.json index 129e53b00a..33b3cc270e 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "npm": "2.x || 3.x || 5.x || 6.x" }, "jest": { - "automock": true, "globals": { "__DEV__": true }, diff --git a/src/component/base/__tests__/DraftEditor.react-test.js b/src/component/base/__tests__/DraftEditor.react-test.js index 88dd374fdf..0e57bd0e2e 100644 --- a/src/component/base/__tests__/DraftEditor.react-test.js +++ b/src/component/base/__tests__/DraftEditor.react-test.js @@ -10,8 +10,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const DraftEditor = require('DraftEditor.react'); diff --git a/src/component/contents/__tests__/DraftEditorBlock.react-test.js b/src/component/contents/__tests__/DraftEditorBlock.react-test.js index ce8c08e12f..578adda6e1 100644 --- a/src/component/contents/__tests__/DraftEditorBlock.react-test.js +++ b/src/component/contents/__tests__/DraftEditorBlock.react-test.js @@ -11,7 +11,6 @@ 'use strict'; jest - .disableAutomock() .mock('Style') .mock('getElementPosition') .mock('getScrollPosition') diff --git a/src/component/contents/__tests__/DraftEditorContents.react-test.js b/src/component/contents/__tests__/DraftEditorContents.react-test.js index 43603791a0..07d3ec317a 100644 --- a/src/component/contents/__tests__/DraftEditorContents.react-test.js +++ b/src/component/contents/__tests__/DraftEditorContents.react-test.js @@ -10,8 +10,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const Editor = require('DraftEditor.react'); diff --git a/src/component/contents/__tests__/DraftEditorTextNode-test.js b/src/component/contents/__tests__/DraftEditorTextNode-test.js index 634ce05cff..44296010e6 100644 --- a/src/component/contents/__tests__/DraftEditorTextNode-test.js +++ b/src/component/contents/__tests__/DraftEditorTextNode-test.js @@ -11,7 +11,7 @@ 'use strict'; -jest.disableAutomock().mock('UserAgent'); +jest.mock('UserAgent'); const BLOCK_DELIMITER_CHAR = '\n'; const TEST_A = 'Hello'; diff --git a/src/component/contents/exploration/__tests__/DraftEditorBlockNode.react-test.js b/src/component/contents/exploration/__tests__/DraftEditorBlockNode.react-test.js index 718037adc2..df3a96ecb5 100644 --- a/src/component/contents/exploration/__tests__/DraftEditorBlockNode.react-test.js +++ b/src/component/contents/exploration/__tests__/DraftEditorBlockNode.react-test.js @@ -11,7 +11,6 @@ 'use strict'; jest - .disableAutomock() .mock('Style') .mock('getElementPosition') .mock('getScrollPosition') diff --git a/src/component/contents/exploration/__tests__/DraftEditorContentsExperimental.react-test.js b/src/component/contents/exploration/__tests__/DraftEditorContentsExperimental.react-test.js index 68f48a3a46..d5d1d65024 100644 --- a/src/component/contents/exploration/__tests__/DraftEditorContentsExperimental.react-test.js +++ b/src/component/contents/exploration/__tests__/DraftEditorContentsExperimental.react-test.js @@ -10,8 +10,6 @@ 'use strict'; -jest.disableAutomock(); - const ContentBlockNode = require('ContentBlockNode'); const ContentState = require('ContentState'); const DefaultDraftBlockRenderMap = require('DefaultDraftBlockRenderMap'); diff --git a/src/component/handlers/composition/__tests__/DraftEditorCompostionHandler-test.js b/src/component/handlers/composition/__tests__/DraftEditorCompostionHandler-test.js index 4dafdf5e68..fcdc0fcc4b 100644 --- a/src/component/handlers/composition/__tests__/DraftEditorCompostionHandler-test.js +++ b/src/component/handlers/composition/__tests__/DraftEditorCompostionHandler-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - // DraftEditorComposition uses timers to detect duplicate `compositionend` // events. jest.useFakeTimers(); diff --git a/src/component/handlers/edit/__tests__/editOnBeforeInput-test.js b/src/component/handlers/edit/__tests__/editOnBeforeInput-test.js index 5f3d8465b5..7f629c0e55 100644 --- a/src/component/handlers/edit/__tests__/editOnBeforeInput-test.js +++ b/src/component/handlers/edit/__tests__/editOnBeforeInput-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - import type DraftEditor from 'DraftEditor.react'; const CompositeDraftDecorator = require('CompositeDraftDecorator'); diff --git a/src/component/handlers/edit/__tests__/editOnBlur-test.js b/src/component/handlers/edit/__tests__/editOnBlur-test.js index a719adda2d..b0100c43f9 100644 --- a/src/component/handlers/edit/__tests__/editOnBlur-test.js +++ b/src/component/handlers/edit/__tests__/editOnBlur-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const ContentBlock = require('ContentBlock'); const ContentState = require('ContentState'); const EditorState = require('EditorState'); diff --git a/src/component/handlers/edit/__tests__/editOnInput-test.js b/src/component/handlers/edit/__tests__/editOnInput-test.js index 147f9329d2..266ad8e7b9 100644 --- a/src/component/handlers/edit/__tests__/editOnInput-test.js +++ b/src/component/handlers/edit/__tests__/editOnInput-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const ContentBlock = require('ContentBlock'); const ContentState = require('ContentState'); const EditorState = require('EditorState'); diff --git a/src/component/handlers/edit/commands/__tests__/SecondaryClipboard-test.js b/src/component/handlers/edit/commands/__tests__/SecondaryClipboard-test.js index 9ae8728449..8598582a5f 100644 --- a/src/component/handlers/edit/commands/__tests__/SecondaryClipboard-test.js +++ b/src/component/handlers/edit/commands/__tests__/SecondaryClipboard-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const toggleExperimentalTreeDataSupport = enabled => { diff --git a/src/component/handlers/edit/commands/__tests__/removeTextWithStrategy-test.js b/src/component/handlers/edit/commands/__tests__/removeTextWithStrategy-test.js index 70a6d78b3f..a4bc58d5f2 100644 --- a/src/component/handlers/edit/commands/__tests__/removeTextWithStrategy-test.js +++ b/src/component/handlers/edit/commands/__tests__/removeTextWithStrategy-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const toggleExperimentalTreeDataSupport = enabled => { diff --git a/src/component/selection/__tests__/DraftOffsetKey-test.js b/src/component/selection/__tests__/DraftOffsetKey-test.js index 6efddd6de6..db28584713 100644 --- a/src/component/selection/__tests__/DraftOffsetKey-test.js +++ b/src/component/selection/__tests__/DraftOffsetKey-test.js @@ -9,8 +9,6 @@ * @flow strict-local */ -jest.disableAutomock(); - const DraftOffsetKey = require('DraftOffsetKey'); test('decodes offset key with no delimiter', () => { diff --git a/src/component/selection/__tests__/getDraftEditorSelection-test.js b/src/component/selection/__tests__/getDraftEditorSelection-test.js index e8bd5c5a87..ffb604e23b 100644 --- a/src/component/selection/__tests__/getDraftEditorSelection-test.js +++ b/src/component/selection/__tests__/getDraftEditorSelection-test.js @@ -10,8 +10,6 @@ 'use strict'; -jest.disableAutomock(); - const getDraftEditorSelection = require('getDraftEditorSelection'); const getSampleSelectionMocksForTesting = require('getSampleSelectionMocksForTesting'); const getSampleSelectionMocksForTestingNestedBlocks = require('getSampleSelectionMocksForTestingNestedBlocks'); diff --git a/src/component/utils/__tests__/getContentEditableContainer-test.js b/src/component/utils/__tests__/getContentEditableContainer-test.js index efc18abb4f..c673027cb8 100644 --- a/src/component/utils/__tests__/getContentEditableContainer-test.js +++ b/src/component/utils/__tests__/getContentEditableContainer-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('ReactDOM'); const getContentEditableContainer = require('getContentEditableContainer'); diff --git a/src/component/utils/exploration/__tests__/DraftTreeAdapter-test.js b/src/component/utils/exploration/__tests__/DraftTreeAdapter-test.js index 98d406a614..aa427f373c 100644 --- a/src/component/utils/exploration/__tests__/DraftTreeAdapter-test.js +++ b/src/component/utils/exploration/__tests__/DraftTreeAdapter-test.js @@ -10,8 +10,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const DraftTreeAdapter = require('DraftTreeAdapter'); diff --git a/src/component/utils/exploration/__tests__/DraftTreeInvariants-test.js b/src/component/utils/exploration/__tests__/DraftTreeInvariants-test.js index aa0536ca9f..cb1fdd2b92 100644 --- a/src/component/utils/exploration/__tests__/DraftTreeInvariants-test.js +++ b/src/component/utils/exploration/__tests__/DraftTreeInvariants-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - // missing parent -> child connection const ContentBlockNode = require('ContentBlockNode'); diff --git a/src/model/decorators/__tests__/CompositeDraftDecorator-test.js b/src/model/decorators/__tests__/CompositeDraftDecorator-test.js index e3972a1c04..fd2d281430 100644 --- a/src/model/decorators/__tests__/CompositeDraftDecorator-test.js +++ b/src/model/decorators/__tests__/CompositeDraftDecorator-test.js @@ -8,7 +8,7 @@ * @format */ -jest.disableAutomock().mock('ContentState'); +jest.mock('ContentState'); const CompositeDraftDecorator = require('CompositeDraftDecorator'); const ContentState = require('ContentState'); diff --git a/src/model/encoding/__tests__/DraftStringKey-test.js b/src/model/encoding/__tests__/DraftStringKey-test.js index f66249110a..8e37d99efc 100644 --- a/src/model/encoding/__tests__/DraftStringKey-test.js +++ b/src/model/encoding/__tests__/DraftStringKey-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const {stringify, unstringify} = require('DraftStringKey'); test('must convert maybe strings to a string key', () => { diff --git a/src/model/encoding/__tests__/convertFromDraftStateToRaw-test.js b/src/model/encoding/__tests__/convertFromDraftStateToRaw-test.js index b13e857f48..3a7e419b32 100644 --- a/src/model/encoding/__tests__/convertFromDraftStateToRaw-test.js +++ b/src/model/encoding/__tests__/convertFromDraftStateToRaw-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const BlockMapBuilder = require('BlockMapBuilder'); const CharacterMetadata = require('CharacterMetadata'); const ContentBlock = require('ContentBlock'); diff --git a/src/model/encoding/__tests__/convertFromHTMLToContentBlocks-test.js b/src/model/encoding/__tests__/convertFromHTMLToContentBlocks-test.js index 161efb186b..4ee5e7099e 100644 --- a/src/model/encoding/__tests__/convertFromHTMLToContentBlocks-test.js +++ b/src/model/encoding/__tests__/convertFromHTMLToContentBlocks-test.js @@ -11,7 +11,6 @@ 'use strict'; -jest.disableAutomock(); expect.addSnapshotSerializer(require('NonASCIIStringSnapshotSerializer')); jest.mock('generateRandomKey'); diff --git a/src/model/encoding/__tests__/convertFromRawToDraftState-test.js b/src/model/encoding/__tests__/convertFromRawToDraftState-test.js index c1b4a89555..f0c9b50a57 100644 --- a/src/model/encoding/__tests__/convertFromRawToDraftState-test.js +++ b/src/model/encoding/__tests__/convertFromRawToDraftState-test.js @@ -10,8 +10,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const convertFromRawToDraftState = require('convertFromRawToDraftState'); diff --git a/src/model/encoding/__tests__/decodeEntityRanges-test.js b/src/model/encoding/__tests__/decodeEntityRanges-test.js index f675d3de50..7d9560650d 100644 --- a/src/model/encoding/__tests__/decodeEntityRanges-test.js +++ b/src/model/encoding/__tests__/decodeEntityRanges-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const decodeEntityRanges = require('decodeEntityRanges'); test('must decode when no entities present', () => { diff --git a/src/model/encoding/__tests__/decodeInlineStyleRanges-test.js b/src/model/encoding/__tests__/decodeInlineStyleRanges-test.js index 24eee7cf1d..418a1be623 100644 --- a/src/model/encoding/__tests__/decodeInlineStyleRanges-test.js +++ b/src/model/encoding/__tests__/decodeInlineStyleRanges-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const decodeInlineStyleRanges = require('decodeInlineStyleRanges'); test('must decode for an unstyled block', () => { diff --git a/src/model/encoding/__tests__/encodeEntityRanges-test.js b/src/model/encoding/__tests__/encodeEntityRanges-test.js index 130905357e..127787eac4 100644 --- a/src/model/encoding/__tests__/encodeEntityRanges-test.js +++ b/src/model/encoding/__tests__/encodeEntityRanges-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const ContentBlock = require('ContentBlock'); const createCharacterList = require('createCharacterList'); diff --git a/src/model/encoding/__tests__/encodeInlineStyleRanges-test.js b/src/model/encoding/__tests__/encodeInlineStyleRanges-test.js index fce9db4f18..36aed8c114 100644 --- a/src/model/encoding/__tests__/encodeInlineStyleRanges-test.js +++ b/src/model/encoding/__tests__/encodeInlineStyleRanges-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const ContentBlock = require('ContentBlock'); const SampleDraftInlineStyle = require('SampleDraftInlineStyle'); diff --git a/src/model/encoding/__tests__/sanitizeDraftText-test.js b/src/model/encoding/__tests__/sanitizeDraftText-test.js index e35fbacf30..5f46f5e3e2 100644 --- a/src/model/encoding/__tests__/sanitizeDraftText-test.js +++ b/src/model/encoding/__tests__/sanitizeDraftText-test.js @@ -9,8 +9,6 @@ * @format */ -jest.disableAutomock(); - const sanitizeDraftText = require('sanitizeDraftText'); test('must strip trailing carriage returns', () => { diff --git a/src/model/entity/__tests__/DraftEntity-test.js b/src/model/entity/__tests__/DraftEntity-test.js index e5f8f0bf50..875707b98c 100644 --- a/src/model/entity/__tests__/DraftEntity-test.js +++ b/src/model/entity/__tests__/DraftEntity-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const DraftEntity = require('DraftEntity'); beforeEach(() => { diff --git a/src/model/entity/__tests__/getEntityKeyForSelection-test.js b/src/model/entity/__tests__/getEntityKeyForSelection-test.js index 74ed85cbb9..d7538e56e1 100644 --- a/src/model/entity/__tests__/getEntityKeyForSelection-test.js +++ b/src/model/entity/__tests__/getEntityKeyForSelection-test.js @@ -9,8 +9,6 @@ * @format */ -jest.disableAutomock(); - const getEntityKeyForSelection = require('getEntityKeyForSelection'); const getSampleStateForTesting = require('getSampleStateForTesting'); diff --git a/src/model/immutable/__tests__/BlockTree-test.js b/src/model/immutable/__tests__/BlockTree-test.js index 1aaac03310..f3f2220b78 100644 --- a/src/model/immutable/__tests__/BlockTree-test.js +++ b/src/model/immutable/__tests__/BlockTree-test.js @@ -10,8 +10,6 @@ 'use strict'; -jest.disableAutomock(); - const BlockTree = require('BlockTree'); const CharacterMetadata = require('CharacterMetadata'); const ContentBlock = require('ContentBlock'); diff --git a/src/model/immutable/__tests__/CharacterMetadata-test.js b/src/model/immutable/__tests__/CharacterMetadata-test.js index 15e468ed91..40d29258ae 100644 --- a/src/model/immutable/__tests__/CharacterMetadata-test.js +++ b/src/model/immutable/__tests__/CharacterMetadata-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const CharacterMetadata = require('CharacterMetadata'); const {BOLD, BOLD_ITALIC, NONE, UNDERLINE} = require('SampleDraftInlineStyle'); diff --git a/src/model/immutable/__tests__/ContentBlock-test.js b/src/model/immutable/__tests__/ContentBlock-test.js index f73a8017b3..aff27c4821 100644 --- a/src/model/immutable/__tests__/ContentBlock-test.js +++ b/src/model/immutable/__tests__/ContentBlock-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const CharacterMetadata = require('CharacterMetadata'); const ContentBlock = require('ContentBlock'); const {BOLD} = require('SampleDraftInlineStyle'); diff --git a/src/model/immutable/__tests__/ContentBlockNode-test.js b/src/model/immutable/__tests__/ContentBlockNode-test.js index 506035cbf8..4be518f9b6 100644 --- a/src/model/immutable/__tests__/ContentBlockNode-test.js +++ b/src/model/immutable/__tests__/ContentBlockNode-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const CharacterMetadata = require('CharacterMetadata'); const ContentBlockNode = require('ContentBlockNode'); const {BOLD, NONE} = require('SampleDraftInlineStyle'); diff --git a/src/model/immutable/__tests__/ContentState-test.js b/src/model/immutable/__tests__/ContentState-test.js index 153d0b92e5..d9167f0248 100644 --- a/src/model/immutable/__tests__/ContentState-test.js +++ b/src/model/immutable/__tests__/ContentState-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('SelectionState'); let contentState; diff --git a/src/model/immutable/__tests__/EditorBidiService-test.js b/src/model/immutable/__tests__/EditorBidiService-test.js index f094b68714..48e8aad63f 100644 --- a/src/model/immutable/__tests__/EditorBidiService-test.js +++ b/src/model/immutable/__tests__/EditorBidiService-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const ContentBlock = require('ContentBlock'); const ContentState = require('ContentState'); const EditorBidiService = require('EditorBidiService'); diff --git a/src/model/immutable/__tests__/EditorState-test.js b/src/model/immutable/__tests__/EditorState-test.js index ec2c667b09..bff2666308 100644 --- a/src/model/immutable/__tests__/EditorState-test.js +++ b/src/model/immutable/__tests__/EditorState-test.js @@ -10,8 +10,6 @@ 'use strict'; -jest.disableAutomock(); - const CharacterMetadata = require('CharacterMetadata'); const ContentBlock = require('ContentBlock'); const ContentState = require('ContentState'); diff --git a/src/model/immutable/__tests__/SelectionState-test.js b/src/model/immutable/__tests__/SelectionState-test.js index 317c659a68..85ce64ec75 100644 --- a/src/model/immutable/__tests__/SelectionState-test.js +++ b/src/model/immutable/__tests__/SelectionState-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const SelectionState = require('SelectionState'); const DEFAULT_CONFIG = { diff --git a/src/model/immutable/__tests__/findRangesImmutable-test.js b/src/model/immutable/__tests__/findRangesImmutable-test.js index 1c9aa2c4da..4fb176ecb0 100644 --- a/src/model/immutable/__tests__/findRangesImmutable-test.js +++ b/src/model/immutable/__tests__/findRangesImmutable-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const findRangesImmutable = require('findRangesImmutable'); const Immutable = require('immutable'); diff --git a/src/model/modifier/__tests__/AtomicBlockUtils-test.js b/src/model/modifier/__tests__/AtomicBlockUtils-test.js index 60bef16f64..b0334eb918 100644 --- a/src/model/modifier/__tests__/AtomicBlockUtils-test.js +++ b/src/model/modifier/__tests__/AtomicBlockUtils-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const AtomicBlockUtils = require('AtomicBlockUtils'); diff --git a/src/model/modifier/__tests__/DraftRemovableWord-test.js b/src/model/modifier/__tests__/DraftRemovableWord-test.js index 22a5631641..e84f82f010 100644 --- a/src/model/modifier/__tests__/DraftRemovableWord-test.js +++ b/src/model/modifier/__tests__/DraftRemovableWord-test.js @@ -11,7 +11,6 @@ 'use strict'; -jest.disableAutomock(); expect.addSnapshotSerializer(require('NonASCIIStringSnapshotSerializer')); const DraftRemovableWord = require('DraftRemovableWord'); diff --git a/src/model/modifier/__tests__/RichTextEditorUtil-test.js b/src/model/modifier/__tests__/RichTextEditorUtil-test.js index 930700d5c9..10d8009893 100644 --- a/src/model/modifier/__tests__/RichTextEditorUtil-test.js +++ b/src/model/modifier/__tests__/RichTextEditorUtil-test.js @@ -8,8 +8,6 @@ * @format */ -jest.disableAutomock(); - const AtomicBlockUtils = require('AtomicBlockUtils'); const DraftModifier = require('DraftModifier'); const EditorState = require('EditorState'); diff --git a/src/model/modifier/exploration/__tests__/DraftTreeOperations-test.js b/src/model/modifier/exploration/__tests__/DraftTreeOperations-test.js index a25eb00cb3..aa9a33bc88 100644 --- a/src/model/modifier/exploration/__tests__/DraftTreeOperations-test.js +++ b/src/model/modifier/exploration/__tests__/DraftTreeOperations-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const ContentBlockNode = require('ContentBlockNode'); diff --git a/src/model/modifier/exploration/__tests__/NestedRichTextEditorUtil-test.js b/src/model/modifier/exploration/__tests__/NestedRichTextEditorUtil-test.js index d921d68ae2..51fc1edc10 100644 --- a/src/model/modifier/exploration/__tests__/NestedRichTextEditorUtil-test.js +++ b/src/model/modifier/exploration/__tests__/NestedRichTextEditorUtil-test.js @@ -8,8 +8,6 @@ * @format */ -jest.disableAutomock(); - jest.mock('generateRandomKey'); const AtomicBlockUtils = require('AtomicBlockUtils'); diff --git a/src/model/paste/__tests__/DraftPasteProcessor-test.js b/src/model/paste/__tests__/DraftPasteProcessor-test.js index c70436df34..7d48ccfb7f 100644 --- a/src/model/paste/__tests__/DraftPasteProcessor-test.js +++ b/src/model/paste/__tests__/DraftPasteProcessor-test.js @@ -10,8 +10,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const DraftPasteProcessor = require('DraftPasteProcessor'); diff --git a/src/model/transaction/__tests__/ContentStateInlineStyle-test.js b/src/model/transaction/__tests__/ContentStateInlineStyle-test.js index 45c55e491a..d9d96fb547 100644 --- a/src/model/transaction/__tests__/ContentStateInlineStyle-test.js +++ b/src/model/transaction/__tests__/ContentStateInlineStyle-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const ContentStateInlineStyle = require('ContentStateInlineStyle'); const getSampleStateForTesting = require('getSampleStateForTesting'); diff --git a/src/model/transaction/__tests__/applyEntityToContentBlock-test.js b/src/model/transaction/__tests__/applyEntityToContentBlock-test.js index 8dc8d717c0..fb9cf49f47 100644 --- a/src/model/transaction/__tests__/applyEntityToContentBlock-test.js +++ b/src/model/transaction/__tests__/applyEntityToContentBlock-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const ContentBlock = require('ContentBlock'); const applyEntityToContentBlock = require('applyEntityToContentBlock'); diff --git a/src/model/transaction/__tests__/applyEntityToContentState-test.js b/src/model/transaction/__tests__/applyEntityToContentState-test.js index 7658058972..c9468479cf 100644 --- a/src/model/transaction/__tests__/applyEntityToContentState-test.js +++ b/src/model/transaction/__tests__/applyEntityToContentState-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const SelectionState = require('SelectionState'); const applyEntityToContentState = require('applyEntityToContentState'); diff --git a/src/model/transaction/__tests__/getContentStateFragment-test.js b/src/model/transaction/__tests__/getContentStateFragment-test.js index 13978f38cc..0281f882ce 100644 --- a/src/model/transaction/__tests__/getContentStateFragment-test.js +++ b/src/model/transaction/__tests__/getContentStateFragment-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const ContentBlock = require('ContentBlock'); diff --git a/src/model/transaction/__tests__/insertFragmentIntoContentState-test.js b/src/model/transaction/__tests__/insertFragmentIntoContentState-test.js index bf34d1251d..a156f9b489 100644 --- a/src/model/transaction/__tests__/insertFragmentIntoContentState-test.js +++ b/src/model/transaction/__tests__/insertFragmentIntoContentState-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const BlockMapBuilder = require('BlockMapBuilder'); diff --git a/src/model/transaction/__tests__/insertIntoList-test.js b/src/model/transaction/__tests__/insertIntoList-test.js index 17aa6240da..f8bd09bc50 100644 --- a/src/model/transaction/__tests__/insertIntoList-test.js +++ b/src/model/transaction/__tests__/insertIntoList-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const Immutable = require('immutable'); const insertIntoList = require('insertIntoList'); diff --git a/src/model/transaction/__tests__/insertTextIntoContentState-test.js b/src/model/transaction/__tests__/insertTextIntoContentState-test.js index e119d3f84a..af06a1a1c3 100644 --- a/src/model/transaction/__tests__/insertTextIntoContentState-test.js +++ b/src/model/transaction/__tests__/insertTextIntoContentState-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const CharacterMetadata = require('CharacterMetadata'); const {BOLD} = require('SampleDraftInlineStyle'); diff --git a/src/model/transaction/__tests__/moveBlockInContentState-test.js b/src/model/transaction/__tests__/moveBlockInContentState-test.js index f6c252b516..d78636e9ea 100644 --- a/src/model/transaction/__tests__/moveBlockInContentState-test.js +++ b/src/model/transaction/__tests__/moveBlockInContentState-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const ContentBlock = require('ContentBlock'); diff --git a/src/model/transaction/__tests__/randomizeBlockMapKeys-test.js b/src/model/transaction/__tests__/randomizeBlockMapKeys-test.js index c841703bec..0c14044d5e 100644 --- a/src/model/transaction/__tests__/randomizeBlockMapKeys-test.js +++ b/src/model/transaction/__tests__/randomizeBlockMapKeys-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const BlockMapBuilder = require('BlockMapBuilder'); diff --git a/src/model/transaction/__tests__/removeEntitiesAtEdges-test.js b/src/model/transaction/__tests__/removeEntitiesAtEdges-test.js index ee6384185b..333b0b095e 100644 --- a/src/model/transaction/__tests__/removeEntitiesAtEdges-test.js +++ b/src/model/transaction/__tests__/removeEntitiesAtEdges-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const applyEntityToContentBlock = require('applyEntityToContentBlock'); const getSampleStateForTesting = require('getSampleStateForTesting'); const removeEntitiesAtEdges = require('removeEntitiesAtEdges'); diff --git a/src/model/transaction/__tests__/removeRangeFromContentState-test.js b/src/model/transaction/__tests__/removeRangeFromContentState-test.js index f5cc268098..d3be631a09 100644 --- a/src/model/transaction/__tests__/removeRangeFromContentState-test.js +++ b/src/model/transaction/__tests__/removeRangeFromContentState-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const BlockMapBuilder = require('BlockMapBuilder'); const ContentBlockNode = require('ContentBlockNode'); const SelectionState = require('SelectionState'); diff --git a/src/model/transaction/__tests__/splitBlockInContentState-test.js b/src/model/transaction/__tests__/splitBlockInContentState-test.js index faac8715b5..f0c5eaf353 100644 --- a/src/model/transaction/__tests__/splitBlockInContentState-test.js +++ b/src/model/transaction/__tests__/splitBlockInContentState-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const BlockMapBuilder = require('BlockMapBuilder'); diff --git a/src/model/transaction/exploration/__tests__/getNextDelimiterBlockKey-test.js b/src/model/transaction/exploration/__tests__/getNextDelimiterBlockKey-test.js index 74d2aba5e4..03b5d86703 100644 --- a/src/model/transaction/exploration/__tests__/getNextDelimiterBlockKey-test.js +++ b/src/model/transaction/exploration/__tests__/getNextDelimiterBlockKey-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - jest.mock('generateRandomKey'); const ContentBlock = require('ContentBlock'); From 280076b77e3dce72a59874e05d7e6935312be0fe Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Sat, 7 Dec 2019 12:09:15 -0800 Subject: [PATCH 2/2] Remove Jest auto mocking from isHTMLBRElement test --- src/component/utils/__tests__/isHTMLBRElement-test.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/component/utils/__tests__/isHTMLBRElement-test.js b/src/component/utils/__tests__/isHTMLBRElement-test.js index 028b651ccd..4a88b8e805 100644 --- a/src/component/utils/__tests__/isHTMLBRElement-test.js +++ b/src/component/utils/__tests__/isHTMLBRElement-test.js @@ -11,8 +11,6 @@ 'use strict'; -jest.disableAutomock(); - const isHTMLBRElement = require('isHTMLBRElement'); test('isHTMLBRElement recognizes null', () => {