Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run code transforms over global{Setup,Teardown} #7562

Merged
merged 6 commits into from
Jan 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove double loop
  • Loading branch information
SimenB committed Jan 18, 2019
commit 86294581c6215acee675ceda99d2a59fe478a452
14 changes: 8 additions & 6 deletions packages/jest-cli/src/runGlobalHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ export default ({
return;
}

const projectConfig =
allTests
.map(t => t.context.config)
.find(c => c[moduleName] === modulePath) ||
// Fallback to first one
allTests[0].context.config;
const correctConfig = allTests.find(
t => t.context.config[moduleName] === modulePath,
);

const projectConfig = correctConfig
? correctConfig.context.config
: // Fallback to first config
allTests[0].context.config;

const transformer = new ScriptTransformer(projectConfig);

Expand Down