-
Notifications
You must be signed in to change notification settings - Fork 54
/
.mocha-reporter.js
33 lines (31 loc) · 1.26 KB
/
.mocha-reporter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//===----------------------------------------------------------------------===//
//
// This source file is part of the VS Code Swift open source project
//
// Copyright (c) 2024 the VS Code Swift project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of VS Code Swift project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
const BaseReporter = require("mocha/lib/reporters/base");
const SpecReporter = require("mocha/lib/reporters/spec");
const JsonReporter = require("mocha/lib/reporters/json");
// Taking inspiration from https://github.com/stanleyhlng/mocha-multi-reporters/issues/108#issuecomment-2028773686
// since mocha-multi-reporters seems to have bugs with newer mocha versions
module.exports = class MultiReporter extends BaseReporter {
constructor(runner, options) {
super(runner, options);
this.reporters = [
new SpecReporter(runner, {
reporterOption: options.reporterOption.specReporterOptions,
}),
new JsonReporter(runner, {
reporterOption: options.reporterOption.jsonReporterOptions,
}),
];
}
};