-
Notifications
You must be signed in to change notification settings - Fork 116
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
Chore: only use source maps when running unit tests in debug mode #514
Conversation
Verified that @jeremypress has signed the CLA. Thanks for the pull request! |
@@ -1,19 +1,28 @@ | |||
require('babel-polyfill'); | |||
|
|||
const { argv } = process; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking for a better way to determine the original command to run the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do this in webpack.config.js, would it work here?
const isRelease = process.env.NODE_ENV === 'production';
const isDev = process.env.NODE_ENV === 'dev';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good catch to turn them off for prod, but we also want to turn them off if we're not running 'debug' in any environment. We never run debug during a production build so it should already be covered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah good point.
resolve: { | ||
alias: { | ||
sinon: 'sinon/pkg/sinon' | ||
} | ||
} | ||
}); | ||
|
||
if (isDebug) { | ||
config.devtool = 'inline-source-map'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will change this to the other source map type once I check it on all of our browsers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
Source maps don't work in phantom, so we should turn them off unless running our tests in debug mode in a browser. This should shave off between 30-45 seconds every place we run our tests; locally, jenkins, and travis.