UNPKG

1.21 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', {
4 value: true
5});
6exports.default = void 0;
7
8function _jestUtil() {
9 const data = require('jest-util');
10
11 _jestUtil = function () {
12 return data;
13 };
14
15 return data;
16}
17
18/**
19 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
20 *
21 * This source code is licensed under the MIT license found in the
22 * LICENSE file in the root directory of this source tree.
23 */
24const {remove: preRunMessageRemove} = _jestUtil().preRunMessage;
25
26class BaseReporter {
27 _error;
28
29 log(message) {
30 process.stderr.write(`${message}\n`);
31 }
32
33 onRunStart(_results, _options) {
34 preRunMessageRemove(process.stderr);
35 }
36 /* eslint-disable @typescript-eslint/no-empty-function */
37
38 onTestCaseResult(_test, _testCaseResult) {}
39
40 onTestResult(_test, _testResult, _results) {}
41
42 onTestStart(_test) {}
43
44 onRunComplete(_testContexts, _aggregatedResults) {}
45 /* eslint-enable */
46
47 _setError(error) {
48 this._error = error;
49 } // Return an error that occurred during reporting. This error will
50 // define whether the test run was successful or failed.
51
52 getLastError() {
53 return this._error;
54 }
55}
56
57exports.default = BaseReporter;