Skip to content

Commit

Permalink
fix: mochaawsome broken (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow authored Mar 14, 2024
1 parent 348e806 commit 6b9dced
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/mocha/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ class Runner extends EventEmitter {
this.emit(EVENT_RUN_BEGIN);
}

get suite() {
return this.#current;
}

end() {
if (!this.#reporter) {
return;
Expand Down
3 changes: 3 additions & 0 deletions packages/mocha/tests/customReporter/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

'use strict';

const assert = require('assert');

class Reporter {
constructor(runner) {
assert(runner.suite, 'missing root suite');
runner.on('test end', (test) => {
console.log({

Check warning on line 11 in packages/mocha/tests/customReporter/reporter.js

View workflow job for this annotation

GitHub Actions / tests (v18)

Unexpected console statement

Check warning on line 11 in packages/mocha/tests/customReporter/reporter.js

View workflow job for this annotation

GitHub Actions / tests (v20)

Unexpected console statement

Check warning on line 11 in packages/mocha/tests/customReporter/reporter.js

View workflow job for this annotation

GitHub Actions / tests (v21)

Unexpected console statement
state: test.state,
Expand Down

0 comments on commit 6b9dced

Please sign in to comment.