How to use the Runner function from mocha

Find comprehensive JavaScript mocha.Runner code examples handpicked from public code repositorys.

41
42
43
44
45
46
47
48
49
50
  EVENT_SUITE_BEGIN, // suite starts
  EVENT_SUITE_END, // suite ends
  EVENT_TEST_BEGIN, // test begins
  EVENT_TEST_END, // test ends
  EVENT_TEST_PENDING, // test pending
} = Mocha.Runner.constants;

const {
  Base,
} = Mocha.reporters;
fork icon3
star icon185
watch icon9

73
74
75
76
77
78
79
80
81
82
83
84
};


const dom = new jsdom.JSDOM('');
global.document = dom.window.document;


const oldRunnerFail = Mocha.Runner.prototype.fail;
Mocha.Runner.prototype.fail = function (test, err) {
  if (err instanceof AssertionError) {
    const errMessage = String(err.message || '');
    const assertIndex = errMessage.indexOf(': expected');
fork icon2
star icon0
watch icon4

+ 3 other calls in file

19
20
21
22
23
24
25
26
27
28
    EVENT_SUITE_END,
    EVENT_TEST_FAIL,
    EVENT_TEST_PASS,
    EVENT_TEST_PENDING,
    EVENT_TEST_RETRY
} = Mocha.Runner.constants,

{inherits} = Mocha.utils,

Base = Mocha.reporters.Base,
fork icon0
star icon0
watch icon0