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

Chore: only use source maps when running unit tests in debug mode #514

Merged
merged 2 commits into from
Dec 4, 2017
Merged

Chore: only use source maps when running unit tests in debug mode #514

merged 2 commits into from
Dec 4, 2017

Conversation

jeremypress
Copy link
Contributor

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.

@boxcla
Copy link

boxcla commented Nov 22, 2017

Verified that @jeremypress has signed the CLA. Thanks for the pull request!

@@ -1,19 +1,28 @@
require('babel-polyfill');

const { argv } = process;
Copy link
Contributor Author

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

Copy link
Contributor

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';

Copy link
Contributor Author

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.

Copy link
Contributor

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';
Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

@jeremypress jeremypress merged commit 06e390d into box:master Dec 4, 2017
@jeremypress jeremypress deleted the unit-test-source-maps branch December 4, 2017 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants