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

Add `NODE_ENV=development` to `test` script to see React errors #2113

Merged
merged 1 commit into from May 2, 2019

Conversation

Projects
2 participants
@kuychaco
Copy link
Member

commented May 1, 2019

Please be sure to read the contributor's guide to the GitHub package before submitting any pull requests.

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • Suggestion: You can use checklists to keep track of progress for the sections on metrics, tests, documentation, and user research.

Description of the Change

This PR sets our test script to run with NODE_ENV=development. Doing so helped us catch/debug a React issue as described in f60d186

Rationale: React runs fewer checks in production mode for efficiency. For example, in development mode it checks that props have not been mutated but in production mode it seems that it does not. We had an issue where tests were failing on CI due to mutated props but not locally until we set the NODE_ENV to be development. Presumably our CI is running with development mode by default. Let's just have this always be the case to err on the side of catching more errors locally.

Screenshot/Gif

N/A

Alternate Designs

N/A

Benefits

Catch bugs more easily / faster!

Possible Drawbacks

None.

Applicable Issues

See f60d186

Metrics

N/A

Tests

N/A

Documentation

N/A

Release Notes

Run tests with NODE_ENV=development to catch dev-mode React errors locally

User Experience Research (Optional)

N/A

Add `NODE_ENV=development` to `test` script to see React errors
React runs fewer checks in production mode for efficiency. For example, in development mode it checks that props have not been mutated. We had an issue where tests were failing on CI due to mutated props but not locally until we set the NODE_ENV to be development. Let's just have this always be the case to err on the side of catching more errors locally.

Co-Authored-By: Ash Wilson <smashwilson@gmail.com>

@kuychaco kuychaco requested a review from smashwilson May 1, 2019

@codecov

This comment has been minimized.

Copy link

commented May 1, 2019

Codecov Report

Merging #2113 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2113      +/-   ##
==========================================
+ Coverage   92.65%   92.66%   +<.01%     
==========================================
  Files         207      207              
  Lines       12045    12045              
  Branches     1764     1764              
==========================================
+ Hits        11160    11161       +1     
+ Misses        885      884       -1
Impacted Files Coverage Δ
lib/atom/gutter.js 92.3% <0%> (+2.56%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b569d0...9758070. Read the comment docs.

@smashwilson
Copy link
Member

left a comment

👍 Thanks!

@kuychaco kuychaco merged commit 655ce43 into master May 2, 2019

14 checks passed

atom.github Build #20190501.29 succeeded
Details
atom.github (Lint) Lint succeeded
Details
atom.github (Linux beta) Linux beta succeeded
Details
atom.github (Linux dev) Linux dev succeeded
Details
atom.github (Linux stable) Linux stable succeeded
Details
atom.github (MacOS beta) MacOS beta succeeded
Details
atom.github (MacOS dev) MacOS dev succeeded
Details
atom.github (MacOS stable) MacOS stable succeeded
Details
atom.github (Snapshot) Snapshot succeeded
Details
atom.github (Windows beta) Windows beta succeeded
Details
atom.github (Windows dev) Windows dev succeeded
Details
atom.github (Windows stable) Windows stable succeeded
Details
codecov/patch Coverage not affected when comparing 9b569d0...9758070
Details
codecov/project 92.66% (+<.01%) compared to 9b569d0
Details

@kuychaco kuychaco deleted the ku-set-node-env-dev-for-tests branch May 2, 2019

@smashwilson smashwilson added this to In progress in Sprint : 4 April 2019 - 8 May 2019 : v0.29.0 via automation May 8, 2019

@smashwilson smashwilson moved this from In progress to Merged in Sprint : 4 April 2019 - 8 May 2019 : v0.29.0 May 8, 2019

@smashwilson smashwilson referenced this pull request May 8, 2019

Closed

v0.29.0-0 QA Review #2129

11 of 11 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.