Skip to content

Commit

Permalink
Keep warnings when process.env.NODE_ENV is not production (#5196)
Browse files Browse the repository at this point in the history
This way the warnings will work in test mode. (`process.env.NODE_ENV === „test“`)
  • Loading branch information
HaNdTriX authored and timneutkens committed Sep 18, 2018
1 parent ee3a73f commit 8e9b84b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class Error extends React.Component {
}
}

if (process.env.NODE_ENV === 'development') {
if (process.env.NODE_ENV !== 'production') {
Error.propTypes = {
statusCode: PropTypes.number
}
Expand Down
2 changes: 1 addition & 1 deletion lib/router/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default class Router {
}

const { url, as, options } = e.state
if (process.env.NODE_ENV === 'development') {
if (process.env.NODE_ENV !== 'production') {
if (typeof url === 'undefined' || typeof as === 'undefined') {
console.warn('`popstate` event triggered but `event.state` did not have `url` or `as` https://err.sh/zeit/next.js/popstate-state-empty')
}
Expand Down

0 comments on commit 8e9b84b

Please sign in to comment.