Skip to content

Conversation

@boneskull
Copy link
Member

Assertions

  • enables RawResult (the result of invokeMocha() or invokeMochaAsync()) to check the exit code via to have code assertion
  • add passed/failing/pending assertions for RawRunResult (the result of runMocha() or runMochaAsync())

Integration test helpers

  • expose getSummary(), which can be used with a RawResult (when not failing)
  • reorganize the module a bit
  • create runMochaAsync() and runMochaJSONAsync() which are like runMocha() and runMochaJSON() except return Promises
  • better trapping of JSON parse errors
  • better default handling of STDERR output in subprocesses (print it instead of suppress it!)
  • do not let the DEBUG env variable reach subprocesses unless it was explicitly supplied
  • add an easily copy-paste-able command prop to summary
  • add some missing docstrings

Ref: #4198

@boneskull boneskull added type: chore generally involving deps, tooling, configuration, etc. semver-patch implementation requires increase of "patch" version number; "bug fixes" labels Apr 21, 2020
@boneskull boneskull self-assigned this Apr 21, 2020
@coveralls
Copy link

coveralls commented Apr 21, 2020

Coverage Status

Coverage remained the same at 93.01% when pulling fe2c342 on boneskull/issue/2839-test-helpers into 13e94b1 on master.

@boneskull boneskull force-pushed the boneskull/issue/2839-test-helpers branch from 056cb91 to 7484ab8 Compare April 24, 2020 19:36
- enables `RawResult` (the result of `invokeMocha()` or `invokeMochaAsync()`) to check the exit code via `to have code` assertion
- add passed/failing/pending assertions for `RawRunResult` (the result of `runMocha()` or `runMochaAsync()`)

- expose `getSummary()`, which can be used with a `RawResult` (when not failing)
- reorganize the module a bit
- create `runMochaAsync()` and `runMochaJSONAsync()` which are like `runMocha()` and `runMochaJSON()` except return `Promise`s
- better trapping of JSON parse errors
- better default handling of `STDERR` output in subprocesses (print it instead of suppress it!)
- do not let the `DEBUG` env variable reach subprocesses _unless it was explicitly supplied_
- add an easily copy-paste-able `command` prop to summary
- add some missing docstrings

Ref: #4198
@boneskull boneskull force-pushed the boneskull/issue/2839-test-helpers branch from a3094b7 to 7ddcf5f Compare April 24, 2020 21:49
@boneskull
Copy link
Member Author

resolved conflict

the same code should be in PR #4240
@boneskull boneskull force-pushed the boneskull/issue/2839-test-helpers branch from 7ddcf5f to fe2c342 Compare April 24, 2020 23:15
@boneskull
Copy link
Member Author

boneskull commented Apr 30, 2020

@mochajs/core any comments?

Copy link
Contributor

@craigtaub craigtaub left a comment

Choose a reason for hiding this comment

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

LGTM. Another example of where real types would help.

@boneskull boneskull merged commit 240cb3d into master May 4, 2020
@boneskull boneskull deleted the boneskull/issue/2839-test-helpers branch May 4, 2020 19:57
@craigtaub craigtaub added this to the next milestone May 21, 2020
craigtaub pushed a commit that referenced this pull request May 21, 2020
* test helper improvements

- enables `RawResult` (the result of `invokeMocha()` or `invokeMochaAsync()`) to check the exit code via `to have code` assertion
- add passed/failing/pending assertions for `RawRunResult` (the result of `runMocha()` or `runMochaAsync()`)

- expose `getSummary()`, which can be used with a `RawResult` (when not failing)
- reorganize the module a bit
- create `runMochaAsync()` and `runMochaJSONAsync()` which are like `runMocha()` and `runMochaJSON()` except return `Promise`s
- better trapping of JSON parse errors
- better default handling of `STDERR` output in subprocesses (print it instead of suppress it!)
- do not let the `DEBUG` env variable reach subprocesses _unless it was explicitly supplied_
- add an easily copy-paste-able `command` prop to summary
- add some missing docstrings

Ref: #4198

* increase timeout in watch test for CI

the same code should be in PR #4240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch implementation requires increase of "patch" version number; "bug fixes" type: chore generally involving deps, tooling, configuration, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants