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

Add Javascript test line numbers #74

Merged
merged 2 commits into from
Apr 27, 2020
Merged

Conversation

h-m-m
Copy link
Collaborator

@h-m-m h-m-m commented Apr 23, 2020

@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:
Screen Shot 2020-04-23 at 5 45 43 PM

After:

Screen Shot 2020-04-23 at 5 49 23 PM

(Yes, also more color 🌈 )

Howard M. Miller added 2 commits April 23, 2020 17:51
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'"
Copy link
Collaborator Author

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()],
Copy link
Collaborator Author

@h-m-m h-m-m Apr 23, 2020

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)

@h-m-m h-m-m force-pushed the javascript-test-line-numbers branch from abbe5ca to 2ebecf9 Compare April 23, 2020 22:07

const babelLoader = environment.loaders.get('babel')
babelLoader.include.push(babelLoader.include[0].concat('../../test'))
Copy link
Collaborator Author

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

@h-m-m h-m-m mentioned this pull request Apr 24, 2020
10 tasks
Copy link
Collaborator

@solebared solebared left a 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"
Copy link
Collaborator Author

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

@maebeale maebeale merged commit fc6b8c1 into master Apr 27, 2020
@maebeale maebeale deleted the javascript-test-line-numbers branch April 28, 2020 23:32
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.

3 participants