How to use the reporters function from mocha

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

22
23
24
25
26
27
28
29
30
var _mocha = require('mocha');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var debug = require('debug')('mocha-ci-slack-reporter');
var Base = _mocha.reporters.Base;

var Reporter = function (_Base) {
  (0, _inherits3.default)(Reporter, _Base);
fork icon5
star icon2
watch icon3

45
46
47
48
49
50
51
52
53
54
  EVENT_TEST_PENDING, // test pending
} = Mocha.Runner.constants;

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

17
18
19
20
21
22
23
24
25
26
 * @property {string} [file]
 * @property {boolean} [keepFailed]
 * @property {string|Mocha.ReporterConstructor} [reporter]
 * @property {*} [reporterOptions]
 */
class FailedTestsReporter extends Mocha.reporters.Base {
  /**
   * @param {Mocha.Runner} runner
   * @param {{ reporterOptions?: ReporterOptions }} [options]
   */
fork icon0
star icon0
watch icon1

+ 4 other calls in file

41
42
43
44
45
46
47
48
49
50
51


const withReporter = (function () {
	if (argv.tfs) {
		{
			return (browserType, runner) => {
				new mocha.reporters.Spec(runner);
				new MochaJUnitReporter(runner, {
					reporterOptions: {
						testsuitesTitle: `${argv.tfs} ${process.platform}`,
						mochaFile: process.env.BUILD_ARTIFACTSTAGINGDIRECTORY ? path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${process.arch}-${browserType}-${argv.tfs.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`) : undefined
fork icon0
star icon0
watch icon1

+ 5 other calls in file

23
24
25
26
27
28
29
30
31
32
33
34
35
        EVENT_TEST_RETRY
    } = Mocha.Runner.constants,


    {inherits} = Mocha.utils,


    Base = Mocha.reporters.Base,
    color = Base.color;


exports = module.exports = SpecWithRetries;

fork icon0
star icon0
watch icon0