diff --git a/integration-tests/__tests__/each.test.js b/integration-tests/__tests__/each.test.js index 54e16cfda251..6e49091519be 100644 --- a/integration-tests/__tests__/each.test.js +++ b/integration-tests/__tests__/each.test.js @@ -14,8 +14,10 @@ const runJest = require('../runJest'); const {extractSummary} = require('../Utils'); const dir = path.resolve(__dirname, '../each'); const SkipOnWindows = require('../../scripts/SkipOnWindows'); +const SkipOnJestCircus = require('../../scripts/SkipOnJestCircus'); SkipOnWindows.suite(); +SkipOnJestCircus.suite(); test('works with passing tests', () => { const result = runJest(dir, ['success.test.js']); diff --git a/packages/jest-runner/src/run_test.js b/packages/jest-runner/src/run_test.js index 8a351610c856..e190f2e9e437 100644 --- a/packages/jest-runner/src/run_test.js +++ b/packages/jest-runner/src/run_test.js @@ -68,8 +68,12 @@ async function runTestInternal( /* $FlowFixMe */ const TestEnvironment = (require(testEnvironment): EnvironmentClass); - /* $FlowFixMe */ - const testFramework = (require(config.testRunner): TestFramework); + const testFramework = ((process.env.JEST_CIRCUS === '1' + ? /* $FlowFixMe */ + require('jest-circus/build/legacy_code_todo_rewrite/jest_adapter.js') // eslint-disable-line import/no-extraneous-dependencies + .default + : /* $FlowFixMe */ + require(config.testRunner)): TestFramework); /* $FlowFixMe */ const Runtime = (require(config.moduleLoader || 'jest-runtime'): Class< RuntimeClass, diff --git a/scripts/SkipOnJestCircus.js b/scripts/SkipOnJestCircus.js new file mode 100644 index 000000000000..b4460d38dfb9 --- /dev/null +++ b/scripts/SkipOnJestCircus.js @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + */ + +/* eslint-disable jest/no-focused-tests */ + +const SkipOnJestCircus = { + suite() { + if (process.env.JEST_CIRCUS === '1') { + fit('does not work on jest-circus', () => { + console.warn('[SKIP] Does not work on jest-circus'); + }); + } + }, + + test() { + if (process.env.JEST_CIRCUS === '1') { + console.warn('[SKIP] Does not work on jest-circus'); + return true; + } + return false; + }, +}; + +module.exports = SkipOnJestCircus;