From ce68bb2591cc653768099cbd640b613f06693d00 Mon Sep 17 00:00:00 2001 From: Tim Griesser Date: Mon, 21 Sep 2020 17:11:28 -0400 Subject: [PATCH] Fix broken integration test due to proper hoist ordering --- e2e/babel-plugin-jest-hoist/__tests__/integration.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e/babel-plugin-jest-hoist/__tests__/integration.test.js b/e2e/babel-plugin-jest-hoist/__tests__/integration.test.js index 3e3dd10de3e2..9f79d123aef4 100644 --- a/e2e/babel-plugin-jest-hoist/__tests__/integration.test.js +++ b/e2e/babel-plugin-jest-hoist/__tests__/integration.test.js @@ -34,6 +34,10 @@ let e; jest.unmock('../__test_modules__/e'); })(); +// Variable names prefixed with `mock` (ignore case) should not throw as out-of-scope +const MockMethods = () => {}; +jest.mock('../__test_modules__/f', () => MockMethods); + jest.mock('../__test_modules__/f', () => { if (!global.CALLS) { global.CALLS = 0; @@ -73,10 +77,6 @@ jest.dontMock('../__test_modules__/Mocked'); const myObject = {mock: () => {}}; myObject.mock('apple', 27); -// Variable names prefixed with `mock` (ignore case) should not throw as out-of-scope -const MockMethods = () => {}; -jest.mock('../__test_modules__/f', () => MockMethods); - describe('babel-plugin-jest-hoist', () => { it('does not throw during transform', () => { const object = {};