Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

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

Merged
merged 1 commit into from
May 2, 2019

Conversation

kuychaco
Copy link
Contributor

@kuychaco kuychaco 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

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 22:53
@codecov
Copy link

codecov bot 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.

Copy link
Contributor

@smashwilson smashwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks!

@kuychaco kuychaco merged commit 655ce43 into master May 2, 2019
@kuychaco kuychaco deleted the ku-set-node-env-dev-for-tests branch May 2, 2019 19:05
@smashwilson smashwilson mentioned this pull request May 8, 2019
11 tasks
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.

2 participants