-
-
Notifications
You must be signed in to change notification settings - Fork 61
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 Javascript test line numbers #74
Conversation
Note: this does not add accurate column numbers. We can add them, though it may have a performance impact Also, this skips source maps for the node_modules folder. On my machine, this sped up compilation time from 2.51s to 1.38s
}, | ||
"scripts": { | ||
"test": "mochapack --webpack-config config/webpack/test.js --require test/setup.js test/**/*.spec.js" | ||
"test": "mochapack --webpack-config config/webpack/test.js --require spec/javascript/setup.js --colors 'spec/javascript/**/*.spec.js'" |
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.
Without the quotes around the glob pattern, it's possible for some wonky shell interpolation to kick in instead of letting mocha handle it
devtoolFallbackModuleFilenameTemplate: '[absolute-resource-path]?[hash]' | ||
}, | ||
mode: 'development', | ||
externals: [nodeExternals()], |
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.
On my machine, this line sped up compilation time from 2.51s to 1.38s. Though I think it was closer to 0.84s as of a day or two ago (before adding source maps)
abbe5ca
to
2ebecf9
Compare
|
||
const babelLoader = environment.loaders.get('babel') | ||
babelLoader.include.push(babelLoader.include[0].concat('../../test')) |
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.
This doesn't seem to be necessary anymore 🤷
I assume #71 made the difference
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.
💯 🚀 Thanks for figuring this out!
"--require", "spec/javascript/setup.js", | ||
"--timeout", "999999", | ||
"--colors", | ||
"spec/javascript/**/*.spec.js" |
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.
I am looking forward to sysgears/mochapack#63 being resolved so that this file can reference a script in package.json instead of the args here potentially getting out of sync
@exbinary pointed out how test errors weren't very helpful, so I looked into it
Note: this does not add accurate column numbers. We can add them, though it may have a performance impact
I created a test with a deliberate typo to get screenshots:
Before:
After:
(Yes, also more color 🌈 )