Make test runners available from yarn run test:*#26671
Make test runners available from yarn run test:*#26671mattkime merged 3 commits intoelastic:masterfrom
yarn run test:*#26671Conversation
|
I think the confusion is caused by us only half-way implementing #11095. I would personally prefer if we added |
|
@spalger I guess I'm a little disappointed to see that we're choosing a non standard route. |
|
I have nothing against executing tests via node scripts, but discoverability nears zero when we don't list these scripts in package.json. Having everything listed under Can I suggest that we create parity between all node scripts and package.json scripts by creating a script alias for each existing node script, and as we add node scripts in the future we add a script alias to package.json? |
|
I would also add that integration with things like VSCode for automating test running is gained very easily with npm scripts. Just a developer DX consideration 😊 |
💚 Build Succeeded |
x-pack/package.json
Outdated
| "test:browser:dev": "gulp testbrowser-dev", | ||
| "test:browser": "gulp testbrowser", | ||
| "test:jest": "node scripts/jest", | ||
| "test:mocha": "grunt test:server #server means tests run in node, not browser, poorly named", |
There was a problem hiding this comment.
If this is poorly named, how about renaming test:server to test:mocha?
|
// cc @silne30 |
|
Is the problem here primarily documentation? It sounds like having them scripts defined in the I am fine with CJ's suggestion of creating aliases for the node scripts, but I don't think we need to have parity with each one. There are some which aren't common enough to justify clobbering run scripts and therefore reducing the discoverability. We should really be focused on improving the documentation and not relying on something like |
package.json
Outdated
| "test:quick": "grunt test:quick", | ||
| "test:browser": "grunt test:browser", | ||
| "test:jest": "node scripts/jest", | ||
| "test:mocha": "grunt test:server #server means tests run in node, not browser, poorly named", |
There was a problem hiding this comment.
I am not sure how I feel about the hack here for comments.
|
I think the issue here is a matter of package.json being a standard. Needing to have docs around a nonstandard way of doing things is fine so long as there in value in doing things a non-standard way. |
💚 Build Succeeded |
|
@tylersmalley I think I've addressed your concerns. |
* yarn test:mocha yarn test:jest, x-pack too * remove inline comments, deprecate test:server and replace with test:mocha
* yarn test:mocha yarn test:jest, x-pack too * remove inline comments, deprecate test:server and replace with test:mocha
Summary
Finding the correct test runner is a bit indirect between Jest and Mocha, x-pack code and the rest. This makes testing functionality more visible since its available via
yarn runand it provides the same interface for different tests.