[Feature] Pass through arguments into Mocha
See original GitHub issue- I’d be willing to implement this feature
Describe the user story
Why
As user of mochapack I want be able to use all the command line features of mocha, both currently and as mocha is updated So that I don’t have to wait on mochapack to be updated
Acceptance Criteria
Scenario:
Given a command line option that mochapack doesn't currently support (ie, `--forbid-pending` or `--file`)
When I add that option when I run mochapack, `npx mochapack --forbid-pending *.test.js`
Then I see mochapack behavior in the same way as the option would behavior in mocha
Describe the solution you’d like
While working on https://github.com/sysgears/mochapack/pull/30 it became clear to me that while it would be easy to add additional mocha options to the cli, it feels sub-optimal to have to essentially write the same code and tests for each option.
I’d like to refactor and add to the internals of mochapack to support a passthrough of args to mocha. That way we don’t need to scramble to support additional args as the mocha people add them.
Describe the drawbacks of your solution
Not sure how this would effect the programmatic API of the mochapack (or if we care about that as a feature). There is a possibility of breaking changes to that API, but as far as I can tell the CLI options are 1 for 1.
I also think it’s possible to implement the changes in a way that the API does not break, with possible deprecation markers being added to certain methods that we want to remove in the future.
Describe alternatives you’ve considered
Looking for feedback on this thread of alternative solutions.
Additional context
This make sense to me given the current requested features from both this project and mocha-webpack
. I also think this could result in a simpler code base as right now mochapack is deeply concerned with the particulars of mocha’s options. I think we should get out of the business of trying to re-implement mocha features.
I am willing to work on this. It feels like a decent chunk of work, though I am admittedly new the project, so my estimate may be off. I wanted to get buy in before embarking on a PR.
Command line option requests:
- https://github.com/sysgears/mochapack/issues/20
- https://github.com/sysgears/mochapack/issues/14
- https://github.com/sysgears/mochapack/issues/5
- https://github.com/zinserjan/mocha-webpack/issues/192
- https://github.com/zinserjan/mocha-webpack/issues/201
- https://github.com/zinserjan/mocha-webpack/issues/197
Probably missed a few, but you get the gist 😆
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (10 by maintainers)
Top GitHub Comments
@Jack-Barry
Generally, anything that improve compatibility with future Mocha versions and reduce maintenance burden should be positive.
@JamesMcMahon Would you consider this resolved as per the finalization of #63?