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

Issue 1059: tsJestConfig overriding jest.config.ts global ts-jest config #1896

Merged
merged 1 commit into from Oct 1, 2019

Conversation

jrista
Copy link
Contributor

@jrista jrista commented Sep 29, 2019

fix(testing): merge rather than replace ts-jest property on global config
resolves #1059

Please make sure you have read the submission guidelines before posting an PR

Please make sure that your commit message follows our format.

Example: fix(nx): must begin with lowercase

Current Behavior (This is the behavior we have today, before the PR is merged)

Any globals specified in jest.config.js are overridden due to reassignment of the ts-jest property of the globals object. This is a brute force reassignment, rather than a merging of globals defined in jest.config.js and those brought in via angular.json config.

Expected Behavior (This is the new behavior we can expect after the PR is merged)

Globals in jest.config.js will be properly merged with config brought in via angular.json. Critically, this will allow diagnostics to be set to false, which seems to be the primary use case that people are running into issues with.

Issue

1059

@jrista
Copy link
Contributor Author

jrista commented Sep 30, 2019

I am honestly not sure why the Travis build is failing. The tests run locally, and it even seems as though the tests succeeded in the Travis build that failed, so I'm at a loss...

@twittwer
Copy link
Contributor

At the top it fails at the checkformat script. Can this be the reason, have you run it locally?
https://travis-ci.org/nrwl/nx/jobs/591198574#L532

The command "if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then yarn checkformat --head=$TRAVIS_PULL_REQUEST_SHA --base=$(git merge-base HEAD $TRAVIS_BRANCH); fi" exited with 1.

@jdpearce
Copy link
Collaborator

jdpearce commented Sep 30, 2019

Thanks for this PR, @jrista - it looks like you haven't run yarn format locally. As @twittwer says, it seems to be failing on the Prettier formatting check.

Apart from that, this looks good to me 👍

@jrista jrista force-pushed the fix/1059/overridden-jest-globals branch from 995ffeb to c8df1ec Compare September 30, 2019 15:42
@jrista
Copy link
Contributor Author

jrista commented Sep 30, 2019

Yup, sorry guys, didn't run yarn format before. Looks like that fixed it.

@jdpearce jdpearce merged commit e13910d into nrwl:master Oct 1, 2019
Doginal pushed a commit to Doginal/nx that referenced this pull request Oct 30, 2019
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JestBuilder not respect globals properties defined in jest.config.js
3 participants