mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-06-13 07:31:12 +00:00
.
This commit is contained in:
parent
fc725ba36b
commit
422b9fdb15
7395 changed files with 1786235 additions and 3476 deletions
23
node_modules/@jest/reporters/LICENSE
generated
vendored
Normal file
23
node_modules/@jest/reporters/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
MIT License
|
||||
|
||||
For Jest software
|
||||
|
||||
Copyright (c) 2014-present, Facebook, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
39
node_modules/@jest/reporters/build/Status.d.ts
generated
vendored
Normal file
39
node_modules/@jest/reporters/build/Status.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
import { AggregatedResult, TestResult } from '@jest/test-result';
|
||||
import { ReporterOnStartOptions } from './types';
|
||||
/**
|
||||
* A class that generates the CLI status of currently running tests
|
||||
* and also provides an ANSI escape sequence to remove status lines
|
||||
* from the terminal.
|
||||
*/
|
||||
export default class Status {
|
||||
private _cache;
|
||||
private _callback?;
|
||||
private _currentTests;
|
||||
private _done;
|
||||
private _emitScheduled;
|
||||
private _estimatedTime;
|
||||
private _interval?;
|
||||
private _aggregatedResults?;
|
||||
private _showStatus;
|
||||
constructor();
|
||||
onChange(callback: () => void): void;
|
||||
runStarted(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions): void;
|
||||
runFinished(): void;
|
||||
testStarted(testPath: Config.Path, config: Config.ProjectConfig): void;
|
||||
testFinished(_config: Config.ProjectConfig, testResult: TestResult, aggregatedResults: AggregatedResult): void;
|
||||
get(): {
|
||||
content: string;
|
||||
clear: string;
|
||||
};
|
||||
private _emit;
|
||||
private _debouncedEmit;
|
||||
private _tick;
|
||||
}
|
||||
//# sourceMappingURL=Status.d.ts.map
|
1
node_modules/@jest/reporters/build/Status.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/Status.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../src/Status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,gBAAgB,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EAAC,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAgD/C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB,OAAO,CAAC,MAAM,CAA0C;IACxD,OAAO,CAAC,SAAS,CAAC,CAAa;IAC/B,OAAO,CAAC,aAAa,CAAkB;IACvC,OAAO,CAAC,KAAK,CAAU;IACvB,OAAO,CAAC,cAAc,CAAU;IAChC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,SAAS,CAAC,CAAiB;IACnC,OAAO,CAAC,kBAAkB,CAAC,CAAmB;IAC9C,OAAO,CAAC,WAAW,CAAU;;IAW7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI;IAI7B,UAAU,CACR,iBAAiB,EAAE,gBAAgB,EACnC,OAAO,EAAE,sBAAsB;IASjC,WAAW;IAMX,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,aAAa;IAS/D,YAAY,CACV,OAAO,EAAE,MAAM,CAAC,aAAa,EAC7B,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,gBAAgB;IAQrC,GAAG;;;;IAmDH,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,KAAK;CAGd"}
|
248
node_modules/@jest/reporters/build/Status.js
generated
vendored
Normal file
248
node_modules/@jest/reporters/build/Status.js
generated
vendored
Normal file
|
@ -0,0 +1,248 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _stringLength() {
|
||||
const data = _interopRequireDefault(require('string-length'));
|
||||
|
||||
_stringLength = function _stringLength() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _utils = require('./utils');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
const RUNNING_TEXT = ' RUNS ';
|
||||
const RUNNING = _chalk().default.reset.inverse.yellow.bold(RUNNING_TEXT) + ' ';
|
||||
/**
|
||||
* This class is a perf optimization for sorting the list of currently
|
||||
* running tests. It tries to keep tests in the same positions without
|
||||
* shifting the whole list.
|
||||
*/
|
||||
|
||||
class CurrentTestList {
|
||||
constructor() {
|
||||
_defineProperty(this, '_array', void 0);
|
||||
|
||||
this._array = [];
|
||||
}
|
||||
|
||||
add(testPath, config) {
|
||||
const index = this._array.indexOf(null);
|
||||
|
||||
const record = {
|
||||
config,
|
||||
testPath
|
||||
};
|
||||
|
||||
if (index !== -1) {
|
||||
this._array[index] = record;
|
||||
} else {
|
||||
this._array.push(record);
|
||||
}
|
||||
}
|
||||
|
||||
delete(testPath) {
|
||||
const record = this._array.find(
|
||||
record => record !== null && record.testPath === testPath
|
||||
);
|
||||
|
||||
this._array[this._array.indexOf(record || null)] = null;
|
||||
}
|
||||
|
||||
get() {
|
||||
return this._array;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A class that generates the CLI status of currently running tests
|
||||
* and also provides an ANSI escape sequence to remove status lines
|
||||
* from the terminal.
|
||||
*/
|
||||
|
||||
class Status {
|
||||
constructor() {
|
||||
_defineProperty(this, '_cache', void 0);
|
||||
|
||||
_defineProperty(this, '_callback', void 0);
|
||||
|
||||
_defineProperty(this, '_currentTests', void 0);
|
||||
|
||||
_defineProperty(this, '_done', void 0);
|
||||
|
||||
_defineProperty(this, '_emitScheduled', void 0);
|
||||
|
||||
_defineProperty(this, '_estimatedTime', void 0);
|
||||
|
||||
_defineProperty(this, '_interval', void 0);
|
||||
|
||||
_defineProperty(this, '_aggregatedResults', void 0);
|
||||
|
||||
_defineProperty(this, '_showStatus', void 0);
|
||||
|
||||
this._cache = null;
|
||||
this._currentTests = new CurrentTestList();
|
||||
this._done = false;
|
||||
this._emitScheduled = false;
|
||||
this._estimatedTime = 0;
|
||||
this._showStatus = false;
|
||||
}
|
||||
|
||||
onChange(callback) {
|
||||
this._callback = callback;
|
||||
}
|
||||
|
||||
runStarted(aggregatedResults, options) {
|
||||
this._estimatedTime = (options && options.estimatedTime) || 0;
|
||||
this._showStatus = options && options.showStatus;
|
||||
this._interval = setInterval(() => this._tick(), 1000);
|
||||
this._aggregatedResults = aggregatedResults;
|
||||
|
||||
this._debouncedEmit();
|
||||
}
|
||||
|
||||
runFinished() {
|
||||
this._done = true;
|
||||
if (this._interval) clearInterval(this._interval);
|
||||
|
||||
this._emit();
|
||||
}
|
||||
|
||||
testStarted(testPath, config) {
|
||||
this._currentTests.add(testPath, config);
|
||||
|
||||
if (!this._showStatus) {
|
||||
this._emit();
|
||||
} else {
|
||||
this._debouncedEmit();
|
||||
}
|
||||
}
|
||||
|
||||
testFinished(_config, testResult, aggregatedResults) {
|
||||
const testFilePath = testResult.testFilePath;
|
||||
this._aggregatedResults = aggregatedResults;
|
||||
|
||||
this._currentTests.delete(testFilePath);
|
||||
|
||||
this._debouncedEmit();
|
||||
}
|
||||
|
||||
get() {
|
||||
if (this._cache) {
|
||||
return this._cache;
|
||||
}
|
||||
|
||||
if (this._done) {
|
||||
return {
|
||||
clear: '',
|
||||
content: ''
|
||||
};
|
||||
}
|
||||
|
||||
const width = process.stdout.columns;
|
||||
let content = '\n';
|
||||
|
||||
this._currentTests.get().forEach(record => {
|
||||
if (record) {
|
||||
const config = record.config,
|
||||
testPath = record.testPath;
|
||||
const projectDisplayName = config.displayName
|
||||
? (0, _utils.printDisplayName)(config) + ' '
|
||||
: '';
|
||||
const prefix = RUNNING + projectDisplayName;
|
||||
content +=
|
||||
(0, _utils.wrapAnsiString)(
|
||||
prefix +
|
||||
(0, _utils.trimAndFormatPath)(
|
||||
(0, _stringLength().default)(prefix),
|
||||
config,
|
||||
testPath,
|
||||
width
|
||||
),
|
||||
width
|
||||
) + '\n';
|
||||
}
|
||||
});
|
||||
|
||||
if (this._showStatus && this._aggregatedResults) {
|
||||
content +=
|
||||
'\n' +
|
||||
(0, _utils.getSummary)(this._aggregatedResults, {
|
||||
estimatedTime: this._estimatedTime,
|
||||
roundTime: true,
|
||||
width
|
||||
});
|
||||
}
|
||||
|
||||
let height = 0;
|
||||
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
if (content[i] === '\n') {
|
||||
height++;
|
||||
}
|
||||
}
|
||||
|
||||
const clear = '\r\x1B[K\r\x1B[1A'.repeat(height);
|
||||
return (this._cache = {
|
||||
clear,
|
||||
content
|
||||
});
|
||||
}
|
||||
|
||||
_emit() {
|
||||
this._cache = null;
|
||||
if (this._callback) this._callback();
|
||||
}
|
||||
|
||||
_debouncedEmit() {
|
||||
if (!this._emitScheduled) {
|
||||
// Perf optimization to avoid two separate renders When
|
||||
// one test finishes and another test starts executing.
|
||||
this._emitScheduled = true;
|
||||
setTimeout(() => {
|
||||
this._emit();
|
||||
|
||||
this._emitScheduled = false;
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
_tick() {
|
||||
this._debouncedEmit();
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = Status;
|
19
node_modules/@jest/reporters/build/base_reporter.d.ts
generated
vendored
Normal file
19
node_modules/@jest/reporters/build/base_reporter.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { AggregatedResult, TestResult } from '@jest/test-result';
|
||||
import { ReporterOnStartOptions, Context, Test, Reporter } from './types';
|
||||
export default class BaseReporter implements Reporter {
|
||||
private _error?;
|
||||
log(message: string): void;
|
||||
onRunStart(_results: AggregatedResult, _options: ReporterOnStartOptions): void;
|
||||
onTestResult(_test: Test, _testResult: TestResult, _results: AggregatedResult): void;
|
||||
onTestStart(_test: Test): void;
|
||||
onRunComplete(_contexts: Set<Context>, _aggregatedResults: AggregatedResult): Promise<void> | void;
|
||||
protected _setError(error: Error): void;
|
||||
getLastError(): Error | undefined;
|
||||
}
|
||||
//# sourceMappingURL=base_reporter.d.ts.map
|
1
node_modules/@jest/reporters/build/base_reporter.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/base_reporter.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"base_reporter.d.ts","sourceRoot":"","sources":["../src/base_reporter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,gBAAgB,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAC,sBAAsB,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAIxE,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,QAAQ;IACnD,OAAO,CAAC,MAAM,CAAC,CAAQ;IAEvB,GAAG,CAAC,OAAO,EAAE,MAAM;IAInB,UAAU,CAAC,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,sBAAsB;IAIvE,YAAY,CACV,KAAK,EAAE,IAAI,EACX,WAAW,EAAE,UAAU,EACvB,QAAQ,EAAE,gBAAgB;IAG5B,WAAW,CAAC,KAAK,EAAE,IAAI;IAEvB,aAAa,CACX,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,EACvB,kBAAkB,EAAE,gBAAgB,GACnC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAEvB,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK;IAMhC,YAAY;CAGb"}
|
63
node_modules/@jest/reporters/build/base_reporter.js
generated
vendored
Normal file
63
node_modules/@jest/reporters/build/base_reporter.js
generated
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function _jestUtil() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
const preRunMessageRemove = _jestUtil().preRunMessage.remove;
|
||||
|
||||
class BaseReporter {
|
||||
constructor() {
|
||||
_defineProperty(this, '_error', void 0);
|
||||
}
|
||||
|
||||
log(message) {
|
||||
process.stderr.write(message + '\n');
|
||||
}
|
||||
|
||||
onRunStart(_results, _options) {
|
||||
preRunMessageRemove(process.stderr);
|
||||
}
|
||||
|
||||
onTestResult(_test, _testResult, _results) {}
|
||||
|
||||
onTestStart(_test) {}
|
||||
|
||||
onRunComplete(_contexts, _aggregatedResults) {}
|
||||
|
||||
_setError(error) {
|
||||
this._error = error;
|
||||
} // Return an error that occurred during reporting. This error will
|
||||
// define whether the test run was successful or failed.
|
||||
|
||||
getLastError() {
|
||||
return this._error;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = BaseReporter;
|
24
node_modules/@jest/reporters/build/coverage_reporter.d.ts
generated
vendored
Normal file
24
node_modules/@jest/reporters/build/coverage_reporter.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
import { AggregatedResult, TestResult } from '@jest/test-result';
|
||||
import { CoverageMap } from 'istanbul-lib-coverage';
|
||||
import BaseReporter from './base_reporter';
|
||||
import { Context, Test, CoverageReporterOptions } from './types';
|
||||
export default class CoverageReporter extends BaseReporter {
|
||||
private _coverageMap;
|
||||
private _globalConfig;
|
||||
private _sourceMapStore;
|
||||
private _options;
|
||||
constructor(globalConfig: Config.GlobalConfig, options?: CoverageReporterOptions);
|
||||
onTestResult(_test: Test, testResult: TestResult, _aggregatedResults: AggregatedResult): void;
|
||||
onRunComplete(contexts: Set<Context>, aggregatedResults: AggregatedResult): Promise<void>;
|
||||
private _addUntestedFiles;
|
||||
private _checkThreshold;
|
||||
getCoverageMap(): CoverageMap;
|
||||
}
|
||||
//# sourceMappingURL=coverage_reporter.d.ts.map
|
1
node_modules/@jest/reporters/build/coverage_reporter.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/coverage_reporter.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"coverage_reporter.d.ts","sourceRoot":"","sources":["../src/coverage_reporter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,gBAAgB,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAK/D,OAAyB,EACvB,WAAW,EAIZ,MAAM,uBAAuB,CAAC;AAK/B,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,OAAO,EAAE,IAAI,EAAkB,uBAAuB,EAAC,MAAM,SAAS,CAAC;AAK/E,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,YAAY;IACxD,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,eAAe,CAAW;IAClC,OAAO,CAAC,QAAQ,CAA0B;gBAGxC,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,OAAO,CAAC,EAAE,uBAAuB;IASnC,YAAY,CACV,KAAK,EAAE,IAAI,EACX,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,gBAAgB;IA6BhC,aAAa,CACjB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,EACtB,iBAAiB,EAAE,gBAAgB;YAoCvB,iBAAiB;IAmG/B,OAAO,CAAC,eAAe;IA2LvB,cAAc,IAAI,WAAW;CAG9B"}
|
571
node_modules/@jest/reporters/build/coverage_reporter.js
generated
vendored
Normal file
571
node_modules/@jest/reporters/build/coverage_reporter.js
generated
vendored
Normal file
|
@ -0,0 +1,571 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function _jestUtil() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _istanbulLibReport() {
|
||||
const data = _interopRequireDefault(require('istanbul-lib-report'));
|
||||
|
||||
_istanbulLibReport = function _istanbulLibReport() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _istanbulReports() {
|
||||
const data = _interopRequireDefault(require('istanbul-reports'));
|
||||
|
||||
_istanbulReports = function _istanbulReports() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _istanbulLibCoverage() {
|
||||
const data = _interopRequireDefault(require('istanbul-lib-coverage'));
|
||||
|
||||
_istanbulLibCoverage = function _istanbulLibCoverage() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _istanbulLibSourceMaps() {
|
||||
const data = _interopRequireDefault(require('istanbul-lib-source-maps'));
|
||||
|
||||
_istanbulLibSourceMaps = function _istanbulLibSourceMaps() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestWorker() {
|
||||
const data = _interopRequireDefault(require('jest-worker'));
|
||||
|
||||
_jestWorker = function _jestWorker() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _glob() {
|
||||
const data = _interopRequireDefault(require('glob'));
|
||||
|
||||
_glob = function _glob() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _base_reporter = _interopRequireDefault(require('./base_reporter'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(
|
||||
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
})
|
||||
);
|
||||
}
|
||||
ownKeys.forEach(function(key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function() {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function(resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
|
||||
}
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
|
||||
}
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
const FAIL_COLOR = _chalk().default.bold.red;
|
||||
|
||||
const RUNNING_TEST_COLOR = _chalk().default.bold.dim;
|
||||
|
||||
class CoverageReporter extends _base_reporter.default {
|
||||
constructor(globalConfig, options) {
|
||||
super();
|
||||
|
||||
_defineProperty(this, '_coverageMap', void 0);
|
||||
|
||||
_defineProperty(this, '_globalConfig', void 0);
|
||||
|
||||
_defineProperty(this, '_sourceMapStore', void 0);
|
||||
|
||||
_defineProperty(this, '_options', void 0);
|
||||
|
||||
this._coverageMap = _istanbulLibCoverage().default.createCoverageMap({});
|
||||
this._globalConfig = globalConfig;
|
||||
this._sourceMapStore = _istanbulLibSourceMaps().default.createSourceMapStore();
|
||||
this._options = options || {};
|
||||
}
|
||||
|
||||
onTestResult(_test, testResult, _aggregatedResults) {
|
||||
if (testResult.coverage) {
|
||||
this._coverageMap.merge(testResult.coverage);
|
||||
}
|
||||
|
||||
const sourceMaps = testResult.sourceMaps;
|
||||
|
||||
if (sourceMaps) {
|
||||
Object.keys(sourceMaps).forEach(sourcePath => {
|
||||
let inputSourceMap;
|
||||
|
||||
try {
|
||||
const coverage = this._coverageMap.fileCoverageFor(sourcePath);
|
||||
|
||||
inputSourceMap = coverage.toJSON().inputSourceMap;
|
||||
} finally {
|
||||
if (inputSourceMap) {
|
||||
this._sourceMapStore.registerMap(sourcePath, inputSourceMap);
|
||||
} else {
|
||||
this._sourceMapStore.registerURL(
|
||||
sourcePath,
|
||||
sourceMaps[sourcePath]
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onRunComplete(contexts, aggregatedResults) {
|
||||
var _this = this;
|
||||
|
||||
return _asyncToGenerator(function*() {
|
||||
yield _this._addUntestedFiles(_this._globalConfig, contexts);
|
||||
|
||||
const _this$_sourceMapStore = _this._sourceMapStore.transformCoverage(
|
||||
_this._coverageMap
|
||||
),
|
||||
map = _this$_sourceMapStore.map,
|
||||
sourceFinder = _this$_sourceMapStore.sourceFinder;
|
||||
|
||||
try {
|
||||
const reportContext = _istanbulLibReport().default.createContext({
|
||||
dir: _this._globalConfig.coverageDirectory,
|
||||
sourceFinder
|
||||
});
|
||||
|
||||
const coverageReporters = _this._globalConfig.coverageReporters || [];
|
||||
|
||||
if (!_this._globalConfig.useStderr && coverageReporters.length < 1) {
|
||||
coverageReporters.push('text-summary');
|
||||
}
|
||||
|
||||
const tree = _istanbulLibReport().default.summarizers.pkg(map);
|
||||
|
||||
coverageReporters.forEach(reporter => {
|
||||
tree.visit(
|
||||
_istanbulReports().default.create(reporter, {}),
|
||||
reportContext
|
||||
);
|
||||
});
|
||||
aggregatedResults.coverageMap = map;
|
||||
} catch (e) {
|
||||
console.error(
|
||||
_chalk().default.red(`
|
||||
Failed to write coverage reports:
|
||||
ERROR: ${e.toString()}
|
||||
STACK: ${e.stack}
|
||||
`)
|
||||
);
|
||||
}
|
||||
|
||||
_this._checkThreshold(_this._globalConfig, map);
|
||||
})();
|
||||
}
|
||||
|
||||
_addUntestedFiles(globalConfig, contexts) {
|
||||
var _this2 = this;
|
||||
|
||||
return _asyncToGenerator(function*() {
|
||||
const files = [];
|
||||
contexts.forEach(context => {
|
||||
const config = context.config;
|
||||
|
||||
if (
|
||||
globalConfig.collectCoverageFrom &&
|
||||
globalConfig.collectCoverageFrom.length
|
||||
) {
|
||||
context.hasteFS
|
||||
.matchFilesWithGlob(
|
||||
globalConfig.collectCoverageFrom,
|
||||
config.rootDir
|
||||
)
|
||||
.forEach(filePath =>
|
||||
files.push({
|
||||
config,
|
||||
path: filePath
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
if (!files.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_jestUtil().isInteractive) {
|
||||
process.stderr.write(
|
||||
RUNNING_TEST_COLOR('Running coverage on untested files...')
|
||||
);
|
||||
}
|
||||
|
||||
let worker;
|
||||
|
||||
if (_this2._globalConfig.maxWorkers <= 1) {
|
||||
worker = require('./coverage_worker');
|
||||
} else {
|
||||
worker = new (_jestWorker()).default(
|
||||
require.resolve('./coverage_worker'),
|
||||
{
|
||||
exposedMethods: ['worker'],
|
||||
maxRetries: 2,
|
||||
numWorkers: _this2._globalConfig.maxWorkers
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const instrumentation = files.map(
|
||||
/*#__PURE__*/
|
||||
(function() {
|
||||
var _ref = _asyncToGenerator(function*(fileObj) {
|
||||
const filename = fileObj.path;
|
||||
const config = fileObj.config;
|
||||
|
||||
if (!_this2._coverageMap.data[filename] && 'worker' in worker) {
|
||||
try {
|
||||
const result = yield worker.worker({
|
||||
config,
|
||||
globalConfig,
|
||||
options: _objectSpread({}, _this2._options, {
|
||||
changedFiles:
|
||||
_this2._options.changedFiles &&
|
||||
Array.from(_this2._options.changedFiles)
|
||||
}),
|
||||
path: filename
|
||||
});
|
||||
|
||||
if (result) {
|
||||
_this2._coverageMap.addFileCoverage(result.coverage);
|
||||
|
||||
if (result.sourceMapPath) {
|
||||
_this2._sourceMapStore.registerURL(
|
||||
filename,
|
||||
result.sourceMapPath
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(
|
||||
_chalk().default.red(
|
||||
[
|
||||
`Failed to collect coverage from ${filename}`,
|
||||
`ERROR: ${error.message}`,
|
||||
`STACK: ${error.stack}`
|
||||
].join('\n')
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return function(_x) {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
})()
|
||||
);
|
||||
|
||||
try {
|
||||
yield Promise.all(instrumentation);
|
||||
} catch (err) {
|
||||
// Do nothing; errors were reported earlier to the console.
|
||||
}
|
||||
|
||||
if (_jestUtil().isInteractive) {
|
||||
(0, _jestUtil().clearLine)(process.stderr);
|
||||
}
|
||||
|
||||
if (worker && 'end' in worker && typeof worker.end === 'function') {
|
||||
worker.end();
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
_checkThreshold(globalConfig, map) {
|
||||
if (globalConfig.coverageThreshold) {
|
||||
function check(name, thresholds, actuals) {
|
||||
return ['statements', 'branches', 'lines', 'functions'].reduce(
|
||||
(errors, key) => {
|
||||
const actual = actuals[key].pct;
|
||||
const actualUncovered = actuals[key].total - actuals[key].covered;
|
||||
const threshold = thresholds[key];
|
||||
|
||||
if (threshold != null) {
|
||||
if (threshold < 0) {
|
||||
if (threshold * -1 < actualUncovered) {
|
||||
errors.push(
|
||||
`Jest: Uncovered count for ${key} (${actualUncovered})` +
|
||||
`exceeds ${name} threshold (${-1 * threshold})`
|
||||
);
|
||||
}
|
||||
} else if (actual < threshold) {
|
||||
errors.push(
|
||||
`Jest: "${name}" coverage threshold for ${key} (${threshold}%) not met: ${actual}%`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
},
|
||||
[]
|
||||
);
|
||||
}
|
||||
|
||||
const THRESHOLD_GROUP_TYPES = {
|
||||
GLOB: 'glob',
|
||||
GLOBAL: 'global',
|
||||
PATH: 'path'
|
||||
};
|
||||
const coveredFiles = map.files();
|
||||
const thresholdGroups = Object.keys(globalConfig.coverageThreshold);
|
||||
const groupTypeByThresholdGroup = {};
|
||||
const filesByGlob = {};
|
||||
const coveredFilesSortedIntoThresholdGroup = coveredFiles.reduce(
|
||||
(files, file) => {
|
||||
const pathOrGlobMatches = thresholdGroups.reduce(
|
||||
(agg, thresholdGroup) => {
|
||||
const absoluteThresholdGroup = _path().default.resolve(
|
||||
thresholdGroup
|
||||
); // The threshold group might be a path:
|
||||
|
||||
if (file.indexOf(absoluteThresholdGroup) === 0) {
|
||||
groupTypeByThresholdGroup[thresholdGroup] =
|
||||
THRESHOLD_GROUP_TYPES.PATH;
|
||||
return agg.concat([[file, thresholdGroup]]);
|
||||
} // If the threshold group is not a path it might be a glob:
|
||||
// Note: glob.sync is slow. By memoizing the files matching each glob
|
||||
// (rather than recalculating it for each covered file) we save a tonne
|
||||
// of execution time.
|
||||
|
||||
if (filesByGlob[absoluteThresholdGroup] === undefined) {
|
||||
filesByGlob[absoluteThresholdGroup] = _glob()
|
||||
.default.sync(absoluteThresholdGroup)
|
||||
.map(filePath => _path().default.resolve(filePath));
|
||||
}
|
||||
|
||||
if (filesByGlob[absoluteThresholdGroup].indexOf(file) > -1) {
|
||||
groupTypeByThresholdGroup[thresholdGroup] =
|
||||
THRESHOLD_GROUP_TYPES.GLOB;
|
||||
return agg.concat([[file, thresholdGroup]]);
|
||||
}
|
||||
|
||||
return agg;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
if (pathOrGlobMatches.length > 0) {
|
||||
return files.concat(pathOrGlobMatches);
|
||||
} // Neither a glob or a path? Toss it in global if there's a global threshold:
|
||||
|
||||
if (thresholdGroups.indexOf(THRESHOLD_GROUP_TYPES.GLOBAL) > -1) {
|
||||
groupTypeByThresholdGroup[THRESHOLD_GROUP_TYPES.GLOBAL] =
|
||||
THRESHOLD_GROUP_TYPES.GLOBAL;
|
||||
return files.concat([[file, THRESHOLD_GROUP_TYPES.GLOBAL]]);
|
||||
} // A covered file that doesn't have a threshold:
|
||||
|
||||
return files.concat([[file, undefined]]);
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
const getFilesInThresholdGroup = thresholdGroup =>
|
||||
coveredFilesSortedIntoThresholdGroup
|
||||
.filter(fileAndGroup => fileAndGroup[1] === thresholdGroup)
|
||||
.map(fileAndGroup => fileAndGroup[0]);
|
||||
|
||||
function combineCoverage(filePaths) {
|
||||
return filePaths
|
||||
.map(filePath => map.fileCoverageFor(filePath))
|
||||
.reduce((combinedCoverage, nextFileCoverage) => {
|
||||
if (combinedCoverage === undefined || combinedCoverage === null) {
|
||||
return nextFileCoverage.toSummary();
|
||||
}
|
||||
|
||||
return combinedCoverage.merge(nextFileCoverage.toSummary());
|
||||
}, undefined);
|
||||
}
|
||||
|
||||
let errors = [];
|
||||
thresholdGroups.forEach(thresholdGroup => {
|
||||
switch (groupTypeByThresholdGroup[thresholdGroup]) {
|
||||
case THRESHOLD_GROUP_TYPES.GLOBAL: {
|
||||
const coverage = combineCoverage(
|
||||
getFilesInThresholdGroup(THRESHOLD_GROUP_TYPES.GLOBAL)
|
||||
);
|
||||
|
||||
if (coverage) {
|
||||
errors = errors.concat(
|
||||
check(
|
||||
thresholdGroup,
|
||||
globalConfig.coverageThreshold[thresholdGroup],
|
||||
coverage
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case THRESHOLD_GROUP_TYPES.PATH: {
|
||||
const coverage = combineCoverage(
|
||||
getFilesInThresholdGroup(thresholdGroup)
|
||||
);
|
||||
|
||||
if (coverage) {
|
||||
errors = errors.concat(
|
||||
check(
|
||||
thresholdGroup,
|
||||
globalConfig.coverageThreshold[thresholdGroup],
|
||||
coverage
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case THRESHOLD_GROUP_TYPES.GLOB:
|
||||
getFilesInThresholdGroup(thresholdGroup).forEach(
|
||||
fileMatchingGlob => {
|
||||
errors = errors.concat(
|
||||
check(
|
||||
fileMatchingGlob,
|
||||
globalConfig.coverageThreshold[thresholdGroup],
|
||||
map.fileCoverageFor(fileMatchingGlob).toSummary()
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
// If the file specified by path is not found, error is returned.
|
||||
if (thresholdGroup !== THRESHOLD_GROUP_TYPES.GLOBAL) {
|
||||
errors = errors.concat(
|
||||
`Jest: Coverage data for ${thresholdGroup} was not found.`
|
||||
);
|
||||
}
|
||||
|
||||
// Sometimes all files in the coverage data are matched by
|
||||
// PATH and GLOB threshold groups in which case, don't error when
|
||||
// the global threshold group doesn't match any files.
|
||||
}
|
||||
});
|
||||
errors = errors.filter(
|
||||
err => err !== undefined && err !== null && err.length > 0
|
||||
);
|
||||
|
||||
if (errors.length > 0) {
|
||||
this.log(`${FAIL_COLOR(errors.join('\n'))}`);
|
||||
|
||||
this._setError(new Error(errors.join('\n')));
|
||||
}
|
||||
}
|
||||
} // Only exposed for the internal runner. Should not be used
|
||||
|
||||
getCoverageMap() {
|
||||
return this._coverageMap;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = CoverageReporter;
|
18
node_modules/@jest/reporters/build/coverage_worker.d.ts
generated
vendored
Normal file
18
node_modules/@jest/reporters/build/coverage_worker.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
import { CoverageReporterSerializedOptions } from './types';
|
||||
import { CoverageWorkerResult } from './generateEmptyCoverage';
|
||||
export declare type CoverageWorkerData = {
|
||||
globalConfig: Config.GlobalConfig;
|
||||
config: Config.ProjectConfig;
|
||||
path: Config.Path;
|
||||
options?: CoverageReporterSerializedOptions;
|
||||
};
|
||||
export { CoverageWorkerResult };
|
||||
export declare function worker({ config, globalConfig, path, options, }: CoverageWorkerData): CoverageWorkerResult | null;
|
||||
//# sourceMappingURL=coverage_worker.d.ts.map
|
1
node_modules/@jest/reporters/build/coverage_worker.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/coverage_worker.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"coverage_worker.d.ts","sourceRoot":"","sources":["../src/coverage_worker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAC,iCAAiC,EAAC,MAAM,SAAS,CAAC;AAE1D,OAA8B,EAC5B,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,oBAAY,kBAAkB,GAAG;IAC/B,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,iCAAiC,CAAC;CAC7C,CAAC;AAEF,OAAO,EAAC,oBAAoB,EAAC,CAAC;AAQ9B,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,OAAO,GACR,EAAE,kBAAkB,GAAG,oBAAoB,GAAG,IAAI,CAQlD"}
|
87
node_modules/@jest/reporters/build/coverage_worker.js
generated
vendored
Normal file
87
node_modules/@jest/reporters/build/coverage_worker.js
generated
vendored
Normal file
|
@ -0,0 +1,87 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.worker = worker;
|
||||
Object.defineProperty(exports, 'CoverageWorkerResult', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _generateEmptyCoverage.CoverageWorkerResult;
|
||||
}
|
||||
});
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require('fs'));
|
||||
|
||||
_fs = function _fs() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _exit() {
|
||||
const data = _interopRequireDefault(require('exit'));
|
||||
|
||||
_exit = function _exit() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _generateEmptyCoverage = _interopRequireWildcard(
|
||||
require('./generateEmptyCoverage')
|
||||
);
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
} else {
|
||||
var newObj = {};
|
||||
if (obj != null) {
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: {};
|
||||
if (desc.get || desc.set) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
return newObj;
|
||||
}
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
// Make sure uncaught errors are logged before we exit.
|
||||
process.on('uncaughtException', err => {
|
||||
console.error(err.stack);
|
||||
(0, _exit().default)(1);
|
||||
});
|
||||
|
||||
function worker({config, globalConfig, path, options}) {
|
||||
return (0, _generateEmptyCoverage.default)(
|
||||
_fs().default.readFileSync(path, 'utf8'),
|
||||
path,
|
||||
globalConfig,
|
||||
config,
|
||||
options && options.changedFiles && new Set(options.changedFiles)
|
||||
);
|
||||
}
|
31
node_modules/@jest/reporters/build/default_reporter.d.ts
generated
vendored
Normal file
31
node_modules/@jest/reporters/build/default_reporter.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
import { AggregatedResult, TestResult } from '@jest/test-result';
|
||||
import { Test, ReporterOnStartOptions } from './types';
|
||||
import BaseReporter from './base_reporter';
|
||||
export default class DefaultReporter extends BaseReporter {
|
||||
private _clear;
|
||||
private _err;
|
||||
protected _globalConfig: Config.GlobalConfig;
|
||||
private _out;
|
||||
private _status;
|
||||
private _bufferedOutput;
|
||||
constructor(globalConfig: Config.GlobalConfig);
|
||||
private _wrapStdio;
|
||||
forceFlushBufferedOutput(): void;
|
||||
private _clearStatus;
|
||||
private _printStatus;
|
||||
onRunStart(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions): void;
|
||||
onTestStart(test: Test): void;
|
||||
onRunComplete(): void;
|
||||
onTestResult(test: Test, testResult: TestResult, aggregatedResults: AggregatedResult): void;
|
||||
testFinished(config: Config.ProjectConfig, testResult: TestResult, aggregatedResults: AggregatedResult): void;
|
||||
printTestFileHeader(_testPath: Config.Path, config: Config.ProjectConfig, result: TestResult): void;
|
||||
printTestFileFailureMessage(_testPath: Config.Path, _config: Config.ProjectConfig, result: TestResult): void;
|
||||
}
|
||||
//# sourceMappingURL=default_reporter.d.ts.map
|
1
node_modules/@jest/reporters/build/default_reporter.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/default_reporter.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"default_reporter.d.ts","sourceRoot":"","sources":["../src/default_reporter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,gBAAgB,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EAAC,IAAI,EAAE,sBAAsB,EAAC,MAAM,SAAS,CAAC;AACrD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAU3C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,YAAY;IACvD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAQ;IACpB,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC,YAAY,CAAC;IAC7C,OAAO,CAAC,IAAI,CAAQ;IACpB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,eAAe,CAA2B;gBAEtC,YAAY,EAAE,MAAM,CAAC,YAAY;IAgB7C,OAAO,CAAC,UAAU;IA8ClB,wBAAwB;IAMxB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,YAAY;IAYpB,UAAU,CACR,iBAAiB,EAAE,gBAAgB,EACnC,OAAO,EAAE,sBAAsB;IAKjC,WAAW,CAAC,IAAI,EAAE,IAAI;IAItB,aAAa;IAQb,YAAY,CACV,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,gBAAgB;IAkBrC,YAAY,CACV,MAAM,EAAE,MAAM,CAAC,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,gBAAgB;IAKrC,mBAAmB,CACjB,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,MAAM,EAAE,MAAM,CAAC,aAAa,EAC5B,MAAM,EAAE,UAAU;IAiBpB,2BAA2B,CACzB,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,OAAO,EAAE,MAAM,CAAC,aAAa,EAC7B,MAAM,EAAE,UAAU;CASrB"}
|
268
node_modules/@jest/reporters/build/default_reporter.js
generated
vendored
Normal file
268
node_modules/@jest/reporters/build/default_reporter.js
generated
vendored
Normal file
|
@ -0,0 +1,268 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function _jestUtil() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _base_reporter = _interopRequireDefault(require('./base_reporter'));
|
||||
|
||||
var _Status = _interopRequireDefault(require('./Status'));
|
||||
|
||||
var _get_result_header = _interopRequireDefault(require('./get_result_header'));
|
||||
|
||||
var _get_snapshot_status = _interopRequireDefault(
|
||||
require('./get_snapshot_status')
|
||||
);
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
const TITLE_BULLET = _chalk().default.bold('\u25cf ');
|
||||
|
||||
class DefaultReporter extends _base_reporter.default {
|
||||
// ANSI clear sequence for the last printed status
|
||||
constructor(globalConfig) {
|
||||
super();
|
||||
|
||||
_defineProperty(this, '_clear', void 0);
|
||||
|
||||
_defineProperty(this, '_err', void 0);
|
||||
|
||||
_defineProperty(this, '_globalConfig', void 0);
|
||||
|
||||
_defineProperty(this, '_out', void 0);
|
||||
|
||||
_defineProperty(this, '_status', void 0);
|
||||
|
||||
_defineProperty(this, '_bufferedOutput', void 0);
|
||||
|
||||
this._globalConfig = globalConfig;
|
||||
this._clear = '';
|
||||
this._out = process.stdout.write.bind(process.stdout);
|
||||
this._err = process.stderr.write.bind(process.stderr);
|
||||
this._status = new _Status.default();
|
||||
this._bufferedOutput = new Set();
|
||||
|
||||
this._wrapStdio(process.stdout);
|
||||
|
||||
this._wrapStdio(process.stderr);
|
||||
|
||||
this._status.onChange(() => {
|
||||
this._clearStatus();
|
||||
|
||||
this._printStatus();
|
||||
});
|
||||
}
|
||||
|
||||
_wrapStdio(stream) {
|
||||
const originalWrite = stream.write;
|
||||
let buffer = [];
|
||||
let timeout = null;
|
||||
|
||||
const flushBufferedOutput = () => {
|
||||
const string = buffer.join('');
|
||||
buffer = []; // This is to avoid conflicts between random output and status text
|
||||
|
||||
this._clearStatus();
|
||||
|
||||
if (string) {
|
||||
originalWrite.call(stream, string);
|
||||
}
|
||||
|
||||
this._printStatus();
|
||||
|
||||
this._bufferedOutput.delete(flushBufferedOutput);
|
||||
};
|
||||
|
||||
this._bufferedOutput.add(flushBufferedOutput);
|
||||
|
||||
const debouncedFlush = () => {
|
||||
// If the process blows up no errors would be printed.
|
||||
// There should be a smart way to buffer stderr, but for now
|
||||
// we just won't buffer it.
|
||||
if (stream === process.stderr) {
|
||||
flushBufferedOutput();
|
||||
} else {
|
||||
if (!timeout) {
|
||||
timeout = setTimeout(() => {
|
||||
flushBufferedOutput();
|
||||
timeout = null;
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
stream.write = chunk => {
|
||||
buffer.push(chunk);
|
||||
debouncedFlush();
|
||||
return true;
|
||||
};
|
||||
} // Don't wait for the debounced call and flush all output immediately.
|
||||
|
||||
forceFlushBufferedOutput() {
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator = this._bufferedOutput[Symbol.iterator](), _step;
|
||||
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
|
||||
_iteratorNormalCompletion = true
|
||||
) {
|
||||
const flushBufferedOutput = _step.value;
|
||||
flushBufferedOutput();
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_clearStatus() {
|
||||
if (_jestUtil().isInteractive) {
|
||||
if (this._globalConfig.useStderr) {
|
||||
this._err(this._clear);
|
||||
} else {
|
||||
this._out(this._clear);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_printStatus() {
|
||||
const _this$_status$get = this._status.get(),
|
||||
content = _this$_status$get.content,
|
||||
clear = _this$_status$get.clear;
|
||||
|
||||
this._clear = clear;
|
||||
|
||||
if (_jestUtil().isInteractive) {
|
||||
if (this._globalConfig.useStderr) {
|
||||
this._err(content);
|
||||
} else {
|
||||
this._out(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onRunStart(aggregatedResults, options) {
|
||||
this._status.runStarted(aggregatedResults, options);
|
||||
}
|
||||
|
||||
onTestStart(test) {
|
||||
this._status.testStarted(test.path, test.context.config);
|
||||
}
|
||||
|
||||
onRunComplete() {
|
||||
this.forceFlushBufferedOutput();
|
||||
|
||||
this._status.runFinished();
|
||||
|
||||
process.stdout.write = this._out;
|
||||
process.stderr.write = this._err;
|
||||
(0, _jestUtil().clearLine)(process.stderr);
|
||||
}
|
||||
|
||||
onTestResult(test, testResult, aggregatedResults) {
|
||||
this.testFinished(test.context.config, testResult, aggregatedResults);
|
||||
|
||||
if (!testResult.skipped) {
|
||||
this.printTestFileHeader(
|
||||
testResult.testFilePath,
|
||||
test.context.config,
|
||||
testResult
|
||||
);
|
||||
this.printTestFileFailureMessage(
|
||||
testResult.testFilePath,
|
||||
test.context.config,
|
||||
testResult
|
||||
);
|
||||
}
|
||||
|
||||
this.forceFlushBufferedOutput();
|
||||
}
|
||||
|
||||
testFinished(config, testResult, aggregatedResults) {
|
||||
this._status.testFinished(config, testResult, aggregatedResults);
|
||||
}
|
||||
|
||||
printTestFileHeader(_testPath, config, result) {
|
||||
this.log(
|
||||
(0, _get_result_header.default)(result, this._globalConfig, config)
|
||||
);
|
||||
|
||||
if (result.console) {
|
||||
this.log(
|
||||
' ' +
|
||||
TITLE_BULLET +
|
||||
'Console\n\n' +
|
||||
(0, _jestUtil().getConsoleOutput)(
|
||||
config.cwd,
|
||||
!!this._globalConfig.verbose,
|
||||
result.console
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
printTestFileFailureMessage(_testPath, _config, result) {
|
||||
if (result.failureMessage) {
|
||||
this.log(result.failureMessage);
|
||||
}
|
||||
|
||||
const didUpdate = this._globalConfig.updateSnapshot === 'all';
|
||||
const snapshotStatuses = (0, _get_snapshot_status.default)(
|
||||
result.snapshot,
|
||||
didUpdate
|
||||
);
|
||||
snapshotStatuses.forEach(this.log);
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = DefaultReporter;
|
13
node_modules/@jest/reporters/build/generateEmptyCoverage.d.ts
generated
vendored
Normal file
13
node_modules/@jest/reporters/build/generateEmptyCoverage.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
export declare type CoverageWorkerResult = {
|
||||
coverage: any;
|
||||
sourceMapPath?: string | null;
|
||||
};
|
||||
export default function (source: string, filename: Config.Path, globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, changedFiles?: Set<Config.Path>): CoverageWorkerResult | null;
|
||||
//# sourceMappingURL=generateEmptyCoverage.d.ts.map
|
1
node_modules/@jest/reporters/build/generateEmptyCoverage.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/generateEmptyCoverage.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"generateEmptyCoverage.d.ts","sourceRoot":"","sources":["../src/generateEmptyCoverage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAKnC,oBAAY,oBAAoB,GAAG;IACjC,QAAQ,EAAE,GAAG,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,CAAC,OAAO,WACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,CAAC,IAAI,EACrB,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,MAAM,EAAE,MAAM,CAAC,aAAa,EAC5B,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAC9B,oBAAoB,GAAG,IAAI,CAuB7B"}
|
75
node_modules/@jest/reporters/build/generateEmptyCoverage.js
generated
vendored
Normal file
75
node_modules/@jest/reporters/build/generateEmptyCoverage.js
generated
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
function _istanbulLibInstrument() {
|
||||
const data = require('istanbul-lib-instrument');
|
||||
|
||||
_istanbulLibInstrument = function _istanbulLibInstrument() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _istanbulLibCoverage() {
|
||||
const data = require('istanbul-lib-coverage');
|
||||
|
||||
_istanbulLibCoverage = function _istanbulLibCoverage() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _transform() {
|
||||
const data = require('@jest/transform');
|
||||
|
||||
_transform = function _transform() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
function _default(source, filename, globalConfig, config, changedFiles) {
|
||||
const coverageOptions = {
|
||||
changedFiles,
|
||||
collectCoverage: globalConfig.collectCoverage,
|
||||
collectCoverageFrom: globalConfig.collectCoverageFrom,
|
||||
collectCoverageOnlyFrom: globalConfig.collectCoverageOnlyFrom
|
||||
};
|
||||
let coverageWorkerResult = null;
|
||||
|
||||
if ((0, _transform().shouldInstrument)(filename, coverageOptions, config)) {
|
||||
// Transform file with instrumentation to make sure initial coverage data is well mapped to original code.
|
||||
const _transformSource = new (_transform()).ScriptTransformer(
|
||||
config
|
||||
).transformSource(filename, source, true),
|
||||
code = _transformSource.code,
|
||||
mapCoverage = _transformSource.mapCoverage,
|
||||
sourceMapPath = _transformSource.sourceMapPath;
|
||||
|
||||
const extracted = (0, _istanbulLibInstrument().readInitialCoverage)(code); // Check extracted initial coverage is not null, this can happen when using /* istanbul ignore file */
|
||||
|
||||
if (extracted) {
|
||||
coverageWorkerResult = {
|
||||
coverage: (0, _istanbulLibCoverage().createFileCoverage)(
|
||||
extracted.coverageData
|
||||
),
|
||||
sourceMapPath: mapCoverage ? sourceMapPath : null
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return coverageWorkerResult;
|
||||
}
|
11
node_modules/@jest/reporters/build/get_result_header.d.ts
generated
vendored
Normal file
11
node_modules/@jest/reporters/build/get_result_header.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
import { TestResult } from '@jest/test-result';
|
||||
declare const _default: (result: TestResult, globalConfig: Config.GlobalConfig, projectConfig?: Config.ProjectConfig | undefined) => string;
|
||||
export default _default;
|
||||
//# sourceMappingURL=get_result_header.d.ts.map
|
1
node_modules/@jest/reporters/build/get_result_header.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/get_result_header.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"get_result_header.d.ts","sourceRoot":"","sources":["../src/get_result_header.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;;AAkB7C,wBAkCE"}
|
73
node_modules/@jest/reporters/build/get_result_header.js
generated
vendored
Normal file
73
node_modules/@jest/reporters/build/get_result_header.js
generated
vendored
Normal file
|
@ -0,0 +1,73 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _utils = require('./utils');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
const LONG_TEST_COLOR = _chalk().default.reset.bold.bgRed; // Explicitly reset for these messages since they can get written out in the
|
||||
// middle of error logging
|
||||
|
||||
const FAIL_TEXT = 'FAIL';
|
||||
const PASS_TEXT = 'PASS';
|
||||
const FAIL = _chalk().default.supportsColor
|
||||
? _chalk().default.reset.inverse.bold.red(` ${FAIL_TEXT} `)
|
||||
: FAIL_TEXT;
|
||||
const PASS = _chalk().default.supportsColor
|
||||
? _chalk().default.reset.inverse.bold.green(` ${PASS_TEXT} `)
|
||||
: PASS_TEXT;
|
||||
|
||||
var _default = (result, globalConfig, projectConfig) => {
|
||||
const testPath = result.testFilePath;
|
||||
const status =
|
||||
result.numFailingTests > 0 || result.testExecError ? FAIL : PASS;
|
||||
const runTime = result.perfStats
|
||||
? (result.perfStats.end - result.perfStats.start) / 1000
|
||||
: null;
|
||||
const testDetail = [];
|
||||
|
||||
if (runTime !== null && runTime > 5) {
|
||||
testDetail.push(LONG_TEST_COLOR(runTime + 's'));
|
||||
}
|
||||
|
||||
if (result.memoryUsage) {
|
||||
const toMB = bytes => Math.floor(bytes / 1024 / 1024);
|
||||
|
||||
testDetail.push(`${toMB(result.memoryUsage)} MB heap size`);
|
||||
}
|
||||
|
||||
const projectDisplayName =
|
||||
projectConfig && projectConfig.displayName
|
||||
? (0, _utils.printDisplayName)(projectConfig) + ' '
|
||||
: '';
|
||||
return (
|
||||
`${status} ${projectDisplayName}${(0, _utils.formatTestPath)(
|
||||
projectConfig ? projectConfig : globalConfig,
|
||||
testPath
|
||||
)}` + (testDetail.length ? ` (${testDetail.join(', ')})` : '')
|
||||
);
|
||||
};
|
||||
|
||||
exports.default = _default;
|
17
node_modules/@jest/reporters/build/get_snapshot_status.d.ts
generated
vendored
Normal file
17
node_modules/@jest/reporters/build/get_snapshot_status.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
declare const _default: (snapshot: {
|
||||
added: number;
|
||||
fileDeleted: boolean;
|
||||
matched: number;
|
||||
unchecked: number;
|
||||
uncheckedKeys: string[];
|
||||
unmatched: number;
|
||||
updated: number;
|
||||
}, afterUpdate: boolean) => string[];
|
||||
export default _default;
|
||||
//# sourceMappingURL=get_snapshot_status.d.ts.map
|
1
node_modules/@jest/reporters/build/get_snapshot_status.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/get_snapshot_status.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"get_snapshot_status.d.ts","sourceRoot":"","sources":["../src/get_snapshot_status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;;;;;;;;AAaH,wBAuDE"}
|
113
node_modules/@jest/reporters/build/get_snapshot_status.js
generated
vendored
Normal file
113
node_modules/@jest/reporters/build/get_snapshot_status.js
generated
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function _jestUtil() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
const ARROW = ' \u203A ';
|
||||
const DOT = ' \u2022 ';
|
||||
|
||||
const FAIL_COLOR = _chalk().default.bold.red;
|
||||
|
||||
const SNAPSHOT_ADDED = _chalk().default.bold.green;
|
||||
|
||||
const SNAPSHOT_UPDATED = _chalk().default.bold.green;
|
||||
|
||||
const SNAPSHOT_OUTDATED = _chalk().default.bold.yellow;
|
||||
|
||||
var _default = (snapshot, afterUpdate) => {
|
||||
const statuses = [];
|
||||
|
||||
if (snapshot.added) {
|
||||
statuses.push(
|
||||
SNAPSHOT_ADDED(
|
||||
ARROW +
|
||||
(0, _jestUtil().pluralize)('snapshot', snapshot.added) +
|
||||
' written.'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.updated) {
|
||||
statuses.push(
|
||||
SNAPSHOT_UPDATED(
|
||||
ARROW +
|
||||
(0, _jestUtil().pluralize)('snapshot', snapshot.updated) +
|
||||
' updated.'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.unmatched) {
|
||||
statuses.push(
|
||||
FAIL_COLOR(
|
||||
ARROW +
|
||||
(0, _jestUtil().pluralize)('snapshot', snapshot.unmatched) +
|
||||
' failed.'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.unchecked) {
|
||||
if (afterUpdate) {
|
||||
statuses.push(
|
||||
SNAPSHOT_UPDATED(
|
||||
ARROW +
|
||||
(0, _jestUtil().pluralize)('snapshot', snapshot.unchecked) +
|
||||
' removed.'
|
||||
)
|
||||
);
|
||||
} else {
|
||||
statuses.push(
|
||||
SNAPSHOT_OUTDATED(
|
||||
ARROW +
|
||||
(0, _jestUtil().pluralize)('snapshot', snapshot.unchecked) +
|
||||
' obsolete'
|
||||
) + '.'
|
||||
);
|
||||
}
|
||||
|
||||
snapshot.uncheckedKeys.forEach(key => {
|
||||
statuses.push(` ${DOT}${key}`);
|
||||
});
|
||||
}
|
||||
|
||||
if (snapshot.fileDeleted) {
|
||||
statuses.push(SNAPSHOT_UPDATED(ARROW + 'snapshot file removed.'));
|
||||
}
|
||||
|
||||
return statuses;
|
||||
};
|
||||
|
||||
exports.default = _default;
|
11
node_modules/@jest/reporters/build/get_snapshot_summary.d.ts
generated
vendored
Normal file
11
node_modules/@jest/reporters/build/get_snapshot_summary.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
import { SnapshotSummary } from '@jest/test-result';
|
||||
declare const _default: (snapshots: SnapshotSummary, globalConfig: Config.GlobalConfig, updateCommand: string) => string[];
|
||||
export default _default;
|
||||
//# sourceMappingURL=get_snapshot_summary.d.ts.map
|
1
node_modules/@jest/reporters/build/get_snapshot_summary.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/get_snapshot_summary.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"get_snapshot_summary.d.ts","sourceRoot":"","sources":["../src/get_snapshot_summary.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;;AAgBlD,wBA0GE"}
|
193
node_modules/@jest/reporters/build/get_snapshot_summary.js
generated
vendored
Normal file
193
node_modules/@jest/reporters/build/get_snapshot_summary.js
generated
vendored
Normal file
|
@ -0,0 +1,193 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function _jestUtil() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _utils = require('./utils');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
const ARROW = ' \u203A ';
|
||||
const DOWN_ARROW = ' \u21B3 ';
|
||||
const DOT = ' \u2022 ';
|
||||
|
||||
const FAIL_COLOR = _chalk().default.bold.red;
|
||||
|
||||
const OBSOLETE_COLOR = _chalk().default.bold.yellow;
|
||||
|
||||
const SNAPSHOT_ADDED = _chalk().default.bold.green;
|
||||
|
||||
const SNAPSHOT_NOTE = _chalk().default.dim;
|
||||
|
||||
const SNAPSHOT_REMOVED = _chalk().default.bold.green;
|
||||
|
||||
const SNAPSHOT_SUMMARY = _chalk().default.bold;
|
||||
|
||||
const SNAPSHOT_UPDATED = _chalk().default.bold.green;
|
||||
|
||||
var _default = (snapshots, globalConfig, updateCommand) => {
|
||||
const summary = [];
|
||||
summary.push(SNAPSHOT_SUMMARY('Snapshot Summary'));
|
||||
|
||||
if (snapshots.added) {
|
||||
summary.push(
|
||||
SNAPSHOT_ADDED(
|
||||
ARROW +
|
||||
(0, _jestUtil().pluralize)('snapshot', snapshots.added) +
|
||||
' written '
|
||||
) +
|
||||
`from ${(0, _jestUtil().pluralize)(
|
||||
'test suite',
|
||||
snapshots.filesAdded
|
||||
)}.`
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshots.unmatched) {
|
||||
summary.push(
|
||||
FAIL_COLOR(
|
||||
`${ARROW}${(0, _jestUtil().pluralize)(
|
||||
'snapshot',
|
||||
snapshots.unmatched
|
||||
)} failed`
|
||||
) +
|
||||
` from ${(0, _jestUtil().pluralize)(
|
||||
'test suite',
|
||||
snapshots.filesUnmatched
|
||||
)}. ` +
|
||||
SNAPSHOT_NOTE(
|
||||
'Inspect your code changes or ' + updateCommand + ' to update them.'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshots.updated) {
|
||||
summary.push(
|
||||
SNAPSHOT_UPDATED(
|
||||
ARROW +
|
||||
(0, _jestUtil().pluralize)('snapshot', snapshots.updated) +
|
||||
' updated '
|
||||
) +
|
||||
`from ${(0, _jestUtil().pluralize)(
|
||||
'test suite',
|
||||
snapshots.filesUpdated
|
||||
)}.`
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshots.filesRemoved) {
|
||||
if (snapshots.didUpdate) {
|
||||
summary.push(
|
||||
SNAPSHOT_REMOVED(
|
||||
`${ARROW}${(0, _jestUtil().pluralize)(
|
||||
'snapshot file',
|
||||
snapshots.filesRemoved
|
||||
)} removed `
|
||||
) +
|
||||
`from ${(0, _jestUtil().pluralize)(
|
||||
'test suite',
|
||||
snapshots.filesRemoved
|
||||
)}.`
|
||||
);
|
||||
} else {
|
||||
summary.push(
|
||||
OBSOLETE_COLOR(
|
||||
`${ARROW}${(0, _jestUtil().pluralize)(
|
||||
'snapshot file',
|
||||
snapshots.filesRemoved
|
||||
)} obsolete `
|
||||
) +
|
||||
`from ${(0, _jestUtil().pluralize)(
|
||||
'test suite',
|
||||
snapshots.filesRemoved
|
||||
)}. ` +
|
||||
SNAPSHOT_NOTE(
|
||||
`To remove ${
|
||||
snapshots.filesRemoved === 1 ? 'it' : 'them all'
|
||||
}, ${updateCommand}.`
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (snapshots.unchecked) {
|
||||
if (snapshots.didUpdate) {
|
||||
summary.push(
|
||||
SNAPSHOT_REMOVED(
|
||||
`${ARROW}${(0, _jestUtil().pluralize)(
|
||||
'snapshot',
|
||||
snapshots.unchecked
|
||||
)} removed `
|
||||
) +
|
||||
`from ${(0, _jestUtil().pluralize)(
|
||||
'test suite',
|
||||
snapshots.uncheckedKeysByFile.length
|
||||
)}.`
|
||||
);
|
||||
} else {
|
||||
summary.push(
|
||||
OBSOLETE_COLOR(
|
||||
`${ARROW}${(0, _jestUtil().pluralize)(
|
||||
'snapshot',
|
||||
snapshots.unchecked
|
||||
)} obsolete `
|
||||
) +
|
||||
`from ${(0, _jestUtil().pluralize)(
|
||||
'test suite',
|
||||
snapshots.uncheckedKeysByFile.length
|
||||
)}. ` +
|
||||
SNAPSHOT_NOTE(
|
||||
`To remove ${
|
||||
snapshots.unchecked === 1 ? 'it' : 'them all'
|
||||
}, ${updateCommand}.`
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
snapshots.uncheckedKeysByFile.forEach(uncheckedFile => {
|
||||
summary.push(
|
||||
` ${DOWN_ARROW}${(0, _utils.formatTestPath)(
|
||||
globalConfig,
|
||||
uncheckedFile.filePath
|
||||
)}`
|
||||
);
|
||||
uncheckedFile.keys.forEach(key => {
|
||||
summary.push(` ${DOT}${key}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return summary;
|
||||
};
|
||||
|
||||
exports.default = _default;
|
14
node_modules/@jest/reporters/build/index.d.ts
generated
vendored
Normal file
14
node_modules/@jest/reporters/build/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
export { default as BaseReporter } from './base_reporter';
|
||||
export { default as CoverageReporter } from './coverage_reporter';
|
||||
export { default as DefaultReporter } from './default_reporter';
|
||||
export { default as NotifyReporter } from './notify_reporter';
|
||||
export { default as SummaryReporter } from './summary_reporter';
|
||||
export { default as VerboseReporter } from './verbose_reporter';
|
||||
export { Reporter, ReporterOnStartOptions } from './types';
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
node_modules/@jest/reporters/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/index.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAE,sBAAsB,EAAC,MAAM,SAAS,CAAC"}
|
71
node_modules/@jest/reporters/build/index.js
generated
vendored
Normal file
71
node_modules/@jest/reporters/build/index.js
generated
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'BaseReporter', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _base_reporter.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'CoverageReporter', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _coverage_reporter.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'DefaultReporter', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _default_reporter.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'NotifyReporter', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _notify_reporter.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'SummaryReporter', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _summary_reporter.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'VerboseReporter', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _verbose_reporter.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'Reporter', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.Reporter;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'ReporterOnStartOptions', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.ReporterOnStartOptions;
|
||||
}
|
||||
});
|
||||
|
||||
var _base_reporter = _interopRequireDefault(require('./base_reporter'));
|
||||
|
||||
var _coverage_reporter = _interopRequireDefault(require('./coverage_reporter'));
|
||||
|
||||
var _default_reporter = _interopRequireDefault(require('./default_reporter'));
|
||||
|
||||
var _notify_reporter = _interopRequireDefault(require('./notify_reporter'));
|
||||
|
||||
var _summary_reporter = _interopRequireDefault(require('./summary_reporter'));
|
||||
|
||||
var _verbose_reporter = _interopRequireDefault(require('./verbose_reporter'));
|
||||
|
||||
var _types = require('./types');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
18
node_modules/@jest/reporters/build/notify_reporter.d.ts
generated
vendored
Normal file
18
node_modules/@jest/reporters/build/notify_reporter.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
import { AggregatedResult } from '@jest/test-result';
|
||||
import { TestSchedulerContext, Context } from './types';
|
||||
import BaseReporter from './base_reporter';
|
||||
export default class NotifyReporter extends BaseReporter {
|
||||
private _startRun;
|
||||
private _globalConfig;
|
||||
private _context;
|
||||
constructor(globalConfig: Config.GlobalConfig, startRun: (globalConfig: Config.GlobalConfig) => any, context: TestSchedulerContext);
|
||||
onRunComplete(contexts: Set<Context>, result: AggregatedResult): void;
|
||||
}
|
||||
//# sourceMappingURL=notify_reporter.d.ts.map
|
1
node_modules/@jest/reporters/build/notify_reporter.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/notify_reporter.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"notify_reporter.d.ts","sourceRoot":"","sources":["../src/notify_reporter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAC,oBAAoB,EAAE,OAAO,EAAC,MAAM,SAAS,CAAC;AACtD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAM3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,YAAY;IACtD,OAAO,CAAC,SAAS,CAA6C;IAC9D,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,QAAQ,CAAuB;gBAGrC,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,YAAY,KAAK,GAAG,EACpD,OAAO,EAAE,oBAAoB;IAQ/B,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI;CAyGtE"}
|
242
node_modules/@jest/reporters/build/notify_reporter.js
generated
vendored
Normal file
242
node_modules/@jest/reporters/build/notify_reporter.js
generated
vendored
Normal file
|
@ -0,0 +1,242 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _util() {
|
||||
const data = _interopRequireDefault(require('util'));
|
||||
|
||||
_util = function _util() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _exit() {
|
||||
const data = _interopRequireDefault(require('exit'));
|
||||
|
||||
_exit = function _exit() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _nodeNotifier() {
|
||||
const data = _interopRequireDefault(require('node-notifier'));
|
||||
|
||||
_nodeNotifier = function _nodeNotifier() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _base_reporter = _interopRequireDefault(require('./base_reporter'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _slicedToArray(arr, i) {
|
||||
return (
|
||||
_arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest()
|
||||
);
|
||||
}
|
||||
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError('Invalid attempt to destructure non-iterable instance');
|
||||
}
|
||||
|
||||
function _iterableToArrayLimit(arr, i) {
|
||||
var _arr = [];
|
||||
var _n = true;
|
||||
var _d = false;
|
||||
var _e = undefined;
|
||||
try {
|
||||
for (
|
||||
var _i = arr[Symbol.iterator](), _s;
|
||||
!(_n = (_s = _i.next()).done);
|
||||
_n = true
|
||||
) {
|
||||
_arr.push(_s.value);
|
||||
if (i && _arr.length === i) break;
|
||||
}
|
||||
} catch (err) {
|
||||
_d = true;
|
||||
_e = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_n && _i['return'] != null) _i['return']();
|
||||
} finally {
|
||||
if (_d) throw _e;
|
||||
}
|
||||
}
|
||||
return _arr;
|
||||
}
|
||||
|
||||
function _arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
const isDarwin = process.platform === 'darwin';
|
||||
|
||||
const icon = _path().default.resolve(__dirname, '../assets/jest_logo.png');
|
||||
|
||||
class NotifyReporter extends _base_reporter.default {
|
||||
constructor(globalConfig, startRun, context) {
|
||||
super();
|
||||
|
||||
_defineProperty(this, '_startRun', void 0);
|
||||
|
||||
_defineProperty(this, '_globalConfig', void 0);
|
||||
|
||||
_defineProperty(this, '_context', void 0);
|
||||
|
||||
this._globalConfig = globalConfig;
|
||||
this._startRun = startRun;
|
||||
this._context = context;
|
||||
}
|
||||
|
||||
onRunComplete(contexts, result) {
|
||||
const success =
|
||||
result.numFailedTests === 0 && result.numRuntimeErrorTestSuites === 0;
|
||||
const firstContext = contexts.values().next();
|
||||
const hasteFS =
|
||||
firstContext && firstContext.value && firstContext.value.hasteFS;
|
||||
let packageName;
|
||||
|
||||
if (hasteFS != null) {
|
||||
// assuming root package.json is the first one
|
||||
const _hasteFS$matchFiles = hasteFS.matchFiles('package.json'),
|
||||
_hasteFS$matchFiles2 = _slicedToArray(_hasteFS$matchFiles, 1),
|
||||
filePath = _hasteFS$matchFiles2[0];
|
||||
|
||||
packageName =
|
||||
filePath != null
|
||||
? hasteFS.getModuleName(filePath)
|
||||
: this._globalConfig.rootDir;
|
||||
} else {
|
||||
packageName = this._globalConfig.rootDir;
|
||||
}
|
||||
|
||||
packageName = packageName != null ? `${packageName} - ` : '';
|
||||
const notifyMode = this._globalConfig.notifyMode;
|
||||
const statusChanged =
|
||||
this._context.previousSuccess !== success || this._context.firstRun;
|
||||
const testsHaveRun = result.numTotalTests !== 0;
|
||||
|
||||
if (
|
||||
testsHaveRun &&
|
||||
success &&
|
||||
(notifyMode === 'always' ||
|
||||
notifyMode === 'success' ||
|
||||
notifyMode === 'success-change' ||
|
||||
(notifyMode === 'change' && statusChanged) ||
|
||||
(notifyMode === 'failure-change' && statusChanged))
|
||||
) {
|
||||
const title = _util().default.format('%s%d%% Passed', packageName, 100);
|
||||
|
||||
const message = _util().default.format(
|
||||
(isDarwin ? '\u2705 ' : '') + '%d tests passed',
|
||||
result.numPassedTests
|
||||
);
|
||||
|
||||
_nodeNotifier().default.notify({
|
||||
icon,
|
||||
message,
|
||||
title
|
||||
});
|
||||
} else if (
|
||||
testsHaveRun &&
|
||||
!success &&
|
||||
(notifyMode === 'always' ||
|
||||
notifyMode === 'failure' ||
|
||||
notifyMode === 'failure-change' ||
|
||||
(notifyMode === 'change' && statusChanged) ||
|
||||
(notifyMode === 'success-change' && statusChanged))
|
||||
) {
|
||||
const failed = result.numFailedTests / result.numTotalTests;
|
||||
|
||||
const title = _util().default.format(
|
||||
'%s%d%% Failed',
|
||||
packageName,
|
||||
Math.ceil(Number.isNaN(failed) ? 0 : failed * 100)
|
||||
);
|
||||
|
||||
const message = _util().default.format(
|
||||
(isDarwin ? '\u26D4\uFE0F ' : '') + '%d of %d tests failed',
|
||||
result.numFailedTests,
|
||||
result.numTotalTests
|
||||
);
|
||||
|
||||
const watchMode = this._globalConfig.watch || this._globalConfig.watchAll;
|
||||
const restartAnswer = 'Run again';
|
||||
const quitAnswer = 'Exit tests';
|
||||
|
||||
if (!watchMode) {
|
||||
_nodeNotifier().default.notify({
|
||||
icon,
|
||||
message,
|
||||
title
|
||||
});
|
||||
} else {
|
||||
_nodeNotifier().default.notify(
|
||||
{
|
||||
actions: [restartAnswer, quitAnswer],
|
||||
closeLabel: 'Close',
|
||||
icon,
|
||||
message,
|
||||
title
|
||||
},
|
||||
(err, _, metadata) => {
|
||||
if (err || !metadata) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (metadata.activationValue === quitAnswer) {
|
||||
(0, _exit().default)(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (metadata.activationValue === restartAnswer) {
|
||||
this._startRun(this._globalConfig);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this._context.previousSuccess = success;
|
||||
this._context.firstRun = false;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = NotifyReporter;
|
22
node_modules/@jest/reporters/build/summary_reporter.d.ts
generated
vendored
Normal file
22
node_modules/@jest/reporters/build/summary_reporter.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
import { AggregatedResult } from '@jest/test-result';
|
||||
import { Context, ReporterOnStartOptions } from './types';
|
||||
import BaseReporter from './base_reporter';
|
||||
export default class SummaryReporter extends BaseReporter {
|
||||
private _estimatedTime;
|
||||
private _globalConfig;
|
||||
constructor(globalConfig: Config.GlobalConfig);
|
||||
private _write;
|
||||
onRunStart(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions): void;
|
||||
onRunComplete(contexts: Set<Context>, aggregatedResults: AggregatedResult): void;
|
||||
private _printSnapshotSummary;
|
||||
private _printSummary;
|
||||
private _getTestSummary;
|
||||
}
|
||||
//# sourceMappingURL=summary_reporter.d.ts.map
|
1
node_modules/@jest/reporters/build/summary_reporter.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/summary_reporter.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"summary_reporter.d.ts","sourceRoot":"","sources":["../src/summary_reporter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,gBAAgB,EAAkB,MAAM,mBAAmB,CAAC;AAGpE,OAAO,EAAC,OAAO,EAAE,sBAAsB,EAAC,MAAM,SAAS,CAAC;AACxD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAwC3C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,YAAY;IACvD,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,aAAa,CAAsB;gBAE/B,YAAY,EAAE,MAAM,CAAC,YAAY;IAW7C,OAAO,CAAC,MAAM;IAMd,UAAU,CACR,iBAAiB,EAAE,gBAAgB,EACnC,OAAO,EAAE,sBAAsB;IAMjC,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,gBAAgB;IAsCzE,OAAO,CAAC,qBAAqB;IA6C7B,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,eAAe;CAgDxB"}
|
275
node_modules/@jest/reporters/build/summary_reporter.js
generated
vendored
Normal file
275
node_modules/@jest/reporters/build/summary_reporter.js
generated
vendored
Normal file
|
@ -0,0 +1,275 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function _jestUtil() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _base_reporter = _interopRequireDefault(require('./base_reporter'));
|
||||
|
||||
var _utils = require('./utils');
|
||||
|
||||
var _get_result_header = _interopRequireDefault(require('./get_result_header'));
|
||||
|
||||
var _get_snapshot_summary = _interopRequireDefault(
|
||||
require('./get_snapshot_summary')
|
||||
);
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
const TEST_SUMMARY_THRESHOLD = 20;
|
||||
const NPM_EVENTS = new Set([
|
||||
'prepublish',
|
||||
'publish',
|
||||
'postpublish',
|
||||
'preinstall',
|
||||
'install',
|
||||
'postinstall',
|
||||
'preuninstall',
|
||||
'uninstall',
|
||||
'postuninstall',
|
||||
'preversion',
|
||||
'version',
|
||||
'postversion',
|
||||
'pretest',
|
||||
'test',
|
||||
'posttest',
|
||||
'prestop',
|
||||
'stop',
|
||||
'poststop',
|
||||
'prestart',
|
||||
'start',
|
||||
'poststart',
|
||||
'prerestart',
|
||||
'restart',
|
||||
'postrestart'
|
||||
]);
|
||||
const _process$env = process.env,
|
||||
npm_config_user_agent = _process$env.npm_config_user_agent,
|
||||
npm_lifecycle_event = _process$env.npm_lifecycle_event,
|
||||
npm_lifecycle_script = _process$env.npm_lifecycle_script;
|
||||
|
||||
class SummaryReporter extends _base_reporter.default {
|
||||
constructor(globalConfig) {
|
||||
super();
|
||||
|
||||
_defineProperty(this, '_estimatedTime', void 0);
|
||||
|
||||
_defineProperty(this, '_globalConfig', void 0);
|
||||
|
||||
this._globalConfig = globalConfig;
|
||||
this._estimatedTime = 0;
|
||||
} // If we write more than one character at a time it is possible that
|
||||
// Node.js exits in the middle of printing the result. This was first observed
|
||||
// in Node.js 0.10 and still persists in Node.js 6.7+.
|
||||
// Let's print the test failure summary character by character which is safer
|
||||
// when hundreds of tests are failing.
|
||||
|
||||
_write(string) {
|
||||
for (let i = 0; i < string.length; i++) {
|
||||
process.stderr.write(string.charAt(i));
|
||||
}
|
||||
}
|
||||
|
||||
onRunStart(aggregatedResults, options) {
|
||||
super.onRunStart(aggregatedResults, options);
|
||||
this._estimatedTime = options.estimatedTime;
|
||||
}
|
||||
|
||||
onRunComplete(contexts, aggregatedResults) {
|
||||
const numTotalTestSuites = aggregatedResults.numTotalTestSuites,
|
||||
testResults = aggregatedResults.testResults,
|
||||
wasInterrupted = aggregatedResults.wasInterrupted;
|
||||
|
||||
if (numTotalTestSuites) {
|
||||
const lastResult = testResults[testResults.length - 1]; // Print a newline if the last test did not fail to line up newlines
|
||||
// similar to when an error would have been thrown in the test.
|
||||
|
||||
if (
|
||||
!this._globalConfig.verbose &&
|
||||
lastResult &&
|
||||
!lastResult.numFailingTests &&
|
||||
!lastResult.testExecError
|
||||
) {
|
||||
this.log('');
|
||||
}
|
||||
|
||||
this._printSummary(aggregatedResults, this._globalConfig);
|
||||
|
||||
this._printSnapshotSummary(
|
||||
aggregatedResults.snapshot,
|
||||
this._globalConfig
|
||||
);
|
||||
|
||||
if (numTotalTestSuites) {
|
||||
let message = (0, _utils.getSummary)(aggregatedResults, {
|
||||
estimatedTime: this._estimatedTime
|
||||
});
|
||||
|
||||
if (!this._globalConfig.silent) {
|
||||
message +=
|
||||
'\n' +
|
||||
(wasInterrupted
|
||||
? _chalk().default.bold.red('Test run was interrupted.')
|
||||
: this._getTestSummary(contexts, this._globalConfig));
|
||||
}
|
||||
|
||||
this.log(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_printSnapshotSummary(snapshots, globalConfig) {
|
||||
if (
|
||||
snapshots.added ||
|
||||
snapshots.filesRemoved ||
|
||||
snapshots.unchecked ||
|
||||
snapshots.unmatched ||
|
||||
snapshots.updated
|
||||
) {
|
||||
let updateCommand;
|
||||
const event = npm_lifecycle_event || '';
|
||||
const prefix = NPM_EVENTS.has(event) ? '' : 'run ';
|
||||
const isYarn =
|
||||
typeof npm_config_user_agent === 'string' &&
|
||||
npm_config_user_agent.includes('yarn');
|
||||
const client = isYarn ? 'yarn' : 'npm';
|
||||
const scriptUsesJest =
|
||||
typeof npm_lifecycle_script === 'string' &&
|
||||
npm_lifecycle_script.includes('jest');
|
||||
|
||||
if (globalConfig.watch || globalConfig.watchAll) {
|
||||
updateCommand = 'press `u`';
|
||||
} else if (event && scriptUsesJest) {
|
||||
updateCommand = `run \`${client +
|
||||
' ' +
|
||||
prefix +
|
||||
event +
|
||||
(isYarn ? '' : ' --')} -u\``;
|
||||
} else {
|
||||
updateCommand = 're-run jest with `-u`';
|
||||
}
|
||||
|
||||
const snapshotSummary = (0, _get_snapshot_summary.default)(
|
||||
snapshots,
|
||||
globalConfig,
|
||||
updateCommand
|
||||
);
|
||||
snapshotSummary.forEach(this.log);
|
||||
this.log(''); // print empty line
|
||||
}
|
||||
}
|
||||
|
||||
_printSummary(aggregatedResults, globalConfig) {
|
||||
// If there were any failing tests and there was a large number of tests
|
||||
// executed, re-print the failing results at the end of execution output.
|
||||
const failedTests = aggregatedResults.numFailedTests;
|
||||
const runtimeErrors = aggregatedResults.numRuntimeErrorTestSuites;
|
||||
|
||||
if (
|
||||
failedTests + runtimeErrors > 0 &&
|
||||
aggregatedResults.numTotalTestSuites > TEST_SUMMARY_THRESHOLD
|
||||
) {
|
||||
this.log(_chalk().default.bold('Summary of all failing tests'));
|
||||
aggregatedResults.testResults.forEach(testResult => {
|
||||
const failureMessage = testResult.failureMessage;
|
||||
|
||||
if (failureMessage) {
|
||||
this._write(
|
||||
(0, _get_result_header.default)(testResult, globalConfig) +
|
||||
'\n' +
|
||||
failureMessage +
|
||||
'\n'
|
||||
);
|
||||
}
|
||||
});
|
||||
this.log(''); // print empty line
|
||||
}
|
||||
}
|
||||
|
||||
_getTestSummary(contexts, globalConfig) {
|
||||
const getMatchingTestsInfo = () => {
|
||||
const prefix = globalConfig.findRelatedTests
|
||||
? ' related to files matching '
|
||||
: ' matching ';
|
||||
return (
|
||||
_chalk().default.dim(prefix) +
|
||||
(0, _jestUtil().testPathPatternToRegExp)(
|
||||
globalConfig.testPathPattern
|
||||
).toString()
|
||||
);
|
||||
};
|
||||
|
||||
let testInfo = '';
|
||||
|
||||
if (globalConfig.runTestsByPath) {
|
||||
testInfo = _chalk().default.dim(' within paths');
|
||||
} else if (globalConfig.onlyChanged) {
|
||||
testInfo = _chalk().default.dim(' related to changed files');
|
||||
} else if (globalConfig.testPathPattern) {
|
||||
testInfo = getMatchingTestsInfo();
|
||||
}
|
||||
|
||||
let nameInfo = '';
|
||||
|
||||
if (globalConfig.runTestsByPath) {
|
||||
nameInfo = ' ' + globalConfig.nonFlagArgs.map(p => `"${p}"`).join(', ');
|
||||
} else if (globalConfig.testNamePattern) {
|
||||
nameInfo =
|
||||
_chalk().default.dim(' with tests matching ') +
|
||||
`"${globalConfig.testNamePattern}"`;
|
||||
}
|
||||
|
||||
const contextInfo =
|
||||
contexts.size > 1
|
||||
? _chalk().default.dim(' in ') +
|
||||
contexts.size +
|
||||
_chalk().default.dim(' projects')
|
||||
: '';
|
||||
return (
|
||||
_chalk().default.dim('Ran all test suites') +
|
||||
testInfo +
|
||||
nameInfo +
|
||||
contextInfo +
|
||||
_chalk().default.dim('.')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = SummaryReporter;
|
73
node_modules/@jest/reporters/build/types.d.ts
generated
vendored
Normal file
73
node_modules/@jest/reporters/build/types.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,73 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
import { AggregatedResult, SerializableError, TestResult } from '@jest/test-result';
|
||||
import { JestEnvironment as Environment } from '@jest/environment';
|
||||
import { ModuleMap, FS as HasteFS } from 'jest-haste-map';
|
||||
import HasteResolver from 'jest-resolve';
|
||||
import Runtime from 'jest-runtime';
|
||||
import { worker } from './coverage_worker';
|
||||
export declare type ReporterOnStartOptions = {
|
||||
estimatedTime: number;
|
||||
showStatus: boolean;
|
||||
};
|
||||
export declare type Context = {
|
||||
config: Config.ProjectConfig;
|
||||
hasteFS: HasteFS;
|
||||
moduleMap: ModuleMap;
|
||||
resolver: HasteResolver;
|
||||
};
|
||||
export declare type Test = {
|
||||
context: Context;
|
||||
duration?: number;
|
||||
path: Config.Path;
|
||||
};
|
||||
export declare type CoverageWorker = {
|
||||
worker: typeof worker;
|
||||
};
|
||||
export declare type CoverageReporterOptions = {
|
||||
changedFiles?: Set<Config.Path>;
|
||||
};
|
||||
export declare type CoverageReporterSerializedOptions = {
|
||||
changedFiles?: Array<Config.Path>;
|
||||
};
|
||||
export declare type OnTestStart = (test: Test) => Promise<void>;
|
||||
export declare type OnTestFailure = (test: Test, error: SerializableError) => Promise<any>;
|
||||
export declare type OnTestSuccess = (test: Test, result: TestResult) => Promise<any>;
|
||||
export interface Reporter {
|
||||
readonly onTestResult: (test: Test, testResult: TestResult, aggregatedResult: AggregatedResult) => Promise<void> | void;
|
||||
readonly onRunStart: (results: AggregatedResult, options: ReporterOnStartOptions) => Promise<void> | void;
|
||||
readonly onTestStart: (test: Test) => Promise<void> | void;
|
||||
readonly onRunComplete: (contexts: Set<Context>, results: AggregatedResult) => Promise<void> | void;
|
||||
readonly getLastError: () => Error | void;
|
||||
}
|
||||
export declare type SummaryOptions = {
|
||||
estimatedTime?: number;
|
||||
roundTime?: boolean;
|
||||
width?: number;
|
||||
};
|
||||
export declare type TestFramework = (globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, environment: Environment, runtime: Runtime, testPath: string) => Promise<TestResult>;
|
||||
export declare type TestRunnerOptions = {
|
||||
serial: boolean;
|
||||
};
|
||||
export declare type TestRunnerContext = {
|
||||
changedFiles?: Set<Config.Path>;
|
||||
};
|
||||
export declare type TestRunData = Array<{
|
||||
context: Context;
|
||||
matches: {
|
||||
allTests: number;
|
||||
tests: Array<Test>;
|
||||
total: number;
|
||||
};
|
||||
}>;
|
||||
export declare type TestSchedulerContext = {
|
||||
firstRun: boolean;
|
||||
previousSuccess: boolean;
|
||||
changedFiles?: Set<Config.Path>;
|
||||
};
|
||||
//# sourceMappingURL=types.d.ts.map
|
1
node_modules/@jest/reporters/build/types.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/types.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,eAAe,IAAI,WAAW,EAAC,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAC,SAAS,EAAE,EAAE,IAAI,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,aAAa,MAAM,cAAc,CAAC;AACzC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAEzC,oBAAY,sBAAsB,GAAG;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,oBAAY,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,oBAAY,IAAI,GAAG;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;CACnB,CAAC;AAEF,oBAAY,cAAc,GAAG;IAAC,MAAM,EAAE,OAAO,MAAM,CAAA;CAAC,CAAC;AAErD,oBAAY,uBAAuB,GAAG;IACpC,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC;AAEF,oBAAY,iCAAiC,GAAG;IAC9C,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CACnC,CAAC;AAEF,oBAAY,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AACxD,oBAAY,aAAa,GAAG,CAC1B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,iBAAiB,KACrB,OAAO,CAAC,GAAG,CAAC,CAAC;AAClB,oBAAY,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAE7E,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,YAAY,EAAE,CACrB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,KAC/B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,CACnB,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,sBAAsB,KAC5B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC3D,QAAQ,CAAC,aAAa,EAAE,CACtB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,EACtB,OAAO,EAAE,gBAAgB,KACtB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,KAAK,GAAG,IAAI,CAAC;CAC3C;AAED,oBAAY,cAAc,GAAG;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,aAAa,GAAG,CAC1B,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,MAAM,EAAE,MAAM,CAAC,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,UAAU,CAAC,CAAC;AAEzB,oBAAY,iBAAiB,GAAG;IAC9B,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC;AAEF,oBAAY,WAAW,GAAG,KAAK,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;CAChE,CAAC,CAAC;AAEH,oBAAY,oBAAoB,GAAG;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC"}
|
3
node_modules/@jest/reporters/build/types.js
generated
vendored
Normal file
3
node_modules/@jest/reporters/build/types.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
'use strict';
|
||||
|
||||
var _coverage_worker = require('./coverage_worker');
|
19
node_modules/@jest/reporters/build/utils.d.ts
generated
vendored
Normal file
19
node_modules/@jest/reporters/build/utils.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
import { AggregatedResult } from '@jest/test-result';
|
||||
import { SummaryOptions } from './types';
|
||||
export declare const printDisplayName: (config: Config.ProjectConfig) => string;
|
||||
export declare const trimAndFormatPath: (pad: number, config: Config.GlobalConfig | Config.ProjectConfig, testPath: string, columns: number) => string;
|
||||
export declare const formatTestPath: (config: Config.GlobalConfig | Config.ProjectConfig, testPath: string) => string;
|
||||
export declare const relativePath: (config: Config.GlobalConfig | Config.ProjectConfig, testPath: string) => {
|
||||
basename: string;
|
||||
dirname: string;
|
||||
};
|
||||
export declare const getSummary: (aggregatedResults: AggregatedResult, options?: SummaryOptions | undefined) => string;
|
||||
export declare const wrapAnsiString: (string: string, terminalWidth: number) => string;
|
||||
//# sourceMappingURL=utils.d.ts.map
|
1
node_modules/@jest/reporters/build/utils.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/utils.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAInD,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAIvC,eAAO,MAAM,gBAAgB,0CAgB5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,gHAmC7B,CAAC;AAEF,eAAO,MAAM,cAAc,kFAM1B,CAAC;AAEF,eAAO,MAAM,YAAY;;;CAcxB,CAAC;AAEF,eAAO,MAAM,UAAU,uFAqFtB,CAAC;AAiCF,eAAO,MAAM,cAAc,mDA2D1B,CAAC"}
|
352
node_modules/@jest/reporters/build/utils.js
generated
vendored
Normal file
352
node_modules/@jest/reporters/build/utils.js
generated
vendored
Normal file
|
@ -0,0 +1,352 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.wrapAnsiString = exports.getSummary = exports.relativePath = exports.formatTestPath = exports.trimAndFormatPath = exports.printDisplayName = void 0;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _slash() {
|
||||
const data = _interopRequireDefault(require('slash'));
|
||||
|
||||
_slash = function _slash() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function _jestUtil() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
const PROGRESS_BAR_WIDTH = 40;
|
||||
|
||||
const printDisplayName = config => {
|
||||
const displayName = config.displayName;
|
||||
|
||||
const white = _chalk().default.reset.inverse.white;
|
||||
|
||||
if (!displayName) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (typeof displayName === 'string') {
|
||||
return _chalk().default.supportsColor
|
||||
? white(` ${displayName} `)
|
||||
: displayName;
|
||||
}
|
||||
|
||||
const name = displayName.name,
|
||||
color = displayName.color;
|
||||
const chosenColor = _chalk().default.reset.inverse[color]
|
||||
? _chalk().default.reset.inverse[color]
|
||||
: white;
|
||||
return _chalk().default.supportsColor ? chosenColor(` ${name} `) : name;
|
||||
};
|
||||
|
||||
exports.printDisplayName = printDisplayName;
|
||||
|
||||
const trimAndFormatPath = (pad, config, testPath, columns) => {
|
||||
const maxLength = columns - pad;
|
||||
const relative = relativePath(config, testPath);
|
||||
const basename = relative.basename;
|
||||
let dirname = relative.dirname; // length is ok
|
||||
|
||||
if ((dirname + _path().default.sep + basename).length <= maxLength) {
|
||||
return (0, _slash().default)(
|
||||
_chalk().default.dim(dirname + _path().default.sep) +
|
||||
_chalk().default.bold(basename)
|
||||
);
|
||||
} // we can fit trimmed dirname and full basename
|
||||
|
||||
const basenameLength = basename.length;
|
||||
|
||||
if (basenameLength + 4 < maxLength) {
|
||||
const dirnameLength = maxLength - 4 - basenameLength;
|
||||
dirname =
|
||||
'...' + dirname.slice(dirname.length - dirnameLength, dirname.length);
|
||||
return (0, _slash().default)(
|
||||
_chalk().default.dim(dirname + _path().default.sep) +
|
||||
_chalk().default.bold(basename)
|
||||
);
|
||||
}
|
||||
|
||||
if (basenameLength + 4 === maxLength) {
|
||||
return (0, _slash().default)(
|
||||
_chalk().default.dim('...' + _path().default.sep) +
|
||||
_chalk().default.bold(basename)
|
||||
);
|
||||
} // can't fit dirname, but can fit trimmed basename
|
||||
|
||||
return (0, _slash().default)(
|
||||
_chalk().default.bold(
|
||||
'...' + basename.slice(basename.length - maxLength - 4, basename.length)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
exports.trimAndFormatPath = trimAndFormatPath;
|
||||
|
||||
const formatTestPath = (config, testPath) => {
|
||||
const _relativePath = relativePath(config, testPath),
|
||||
dirname = _relativePath.dirname,
|
||||
basename = _relativePath.basename;
|
||||
|
||||
return (0, _slash().default)(
|
||||
_chalk().default.dim(dirname + _path().default.sep) +
|
||||
_chalk().default.bold(basename)
|
||||
);
|
||||
};
|
||||
|
||||
exports.formatTestPath = formatTestPath;
|
||||
|
||||
const relativePath = (config, testPath) => {
|
||||
// this function can be called with ProjectConfigs or GlobalConfigs. GlobalConfigs
|
||||
// do not have config.cwd, only config.rootDir. Try using config.cwd, fallback
|
||||
// to config.rootDir. (Also, some unit just use config.rootDir, which is ok)
|
||||
testPath = _path().default.relative(config.cwd || config.rootDir, testPath);
|
||||
|
||||
const dirname = _path().default.dirname(testPath);
|
||||
|
||||
const basename = _path().default.basename(testPath);
|
||||
|
||||
return {
|
||||
basename,
|
||||
dirname
|
||||
};
|
||||
};
|
||||
|
||||
exports.relativePath = relativePath;
|
||||
|
||||
const getSummary = (aggregatedResults, options) => {
|
||||
let runTime = (Date.now() - aggregatedResults.startTime) / 1000;
|
||||
|
||||
if (options && options.roundTime) {
|
||||
runTime = Math.floor(runTime);
|
||||
}
|
||||
|
||||
const estimatedTime = (options && options.estimatedTime) || 0;
|
||||
const snapshotResults = aggregatedResults.snapshot;
|
||||
const snapshotsAdded = snapshotResults.added;
|
||||
const snapshotsFailed = snapshotResults.unmatched;
|
||||
const snapshotsOutdated = snapshotResults.unchecked;
|
||||
const snapshotsFilesRemoved = snapshotResults.filesRemoved;
|
||||
const snapshotsDidUpdate = snapshotResults.didUpdate;
|
||||
const snapshotsPassed = snapshotResults.matched;
|
||||
const snapshotsTotal = snapshotResults.total;
|
||||
const snapshotsUpdated = snapshotResults.updated;
|
||||
const suitesFailed = aggregatedResults.numFailedTestSuites;
|
||||
const suitesPassed = aggregatedResults.numPassedTestSuites;
|
||||
const suitesPending = aggregatedResults.numPendingTestSuites;
|
||||
const suitesRun = suitesFailed + suitesPassed;
|
||||
const suitesTotal = aggregatedResults.numTotalTestSuites;
|
||||
const testsFailed = aggregatedResults.numFailedTests;
|
||||
const testsPassed = aggregatedResults.numPassedTests;
|
||||
const testsPending = aggregatedResults.numPendingTests;
|
||||
const testsTodo = aggregatedResults.numTodoTests;
|
||||
const testsTotal = aggregatedResults.numTotalTests;
|
||||
const width = (options && options.width) || 0;
|
||||
const suites =
|
||||
_chalk().default.bold('Test Suites: ') +
|
||||
(suitesFailed
|
||||
? _chalk().default.bold.red(`${suitesFailed} failed`) + ', '
|
||||
: '') +
|
||||
(suitesPending
|
||||
? _chalk().default.bold.yellow(`${suitesPending} skipped`) + ', '
|
||||
: '') +
|
||||
(suitesPassed
|
||||
? _chalk().default.bold.green(`${suitesPassed} passed`) + ', '
|
||||
: '') +
|
||||
(suitesRun !== suitesTotal
|
||||
? suitesRun + ' of ' + suitesTotal
|
||||
: suitesTotal) +
|
||||
` total`;
|
||||
const tests =
|
||||
_chalk().default.bold('Tests: ') +
|
||||
(testsFailed
|
||||
? _chalk().default.bold.red(`${testsFailed} failed`) + ', '
|
||||
: '') +
|
||||
(testsPending
|
||||
? _chalk().default.bold.yellow(`${testsPending} skipped`) + ', '
|
||||
: '') +
|
||||
(testsTodo
|
||||
? _chalk().default.bold.magenta(`${testsTodo} todo`) + ', '
|
||||
: '') +
|
||||
(testsPassed
|
||||
? _chalk().default.bold.green(`${testsPassed} passed`) + ', '
|
||||
: '') +
|
||||
`${testsTotal} total`;
|
||||
const snapshots =
|
||||
_chalk().default.bold('Snapshots: ') +
|
||||
(snapshotsFailed
|
||||
? _chalk().default.bold.red(`${snapshotsFailed} failed`) + ', '
|
||||
: '') +
|
||||
(snapshotsOutdated && !snapshotsDidUpdate
|
||||
? _chalk().default.bold.yellow(`${snapshotsOutdated} obsolete`) + ', '
|
||||
: '') +
|
||||
(snapshotsOutdated && snapshotsDidUpdate
|
||||
? _chalk().default.bold.green(`${snapshotsOutdated} removed`) + ', '
|
||||
: '') +
|
||||
(snapshotsFilesRemoved && !snapshotsDidUpdate
|
||||
? _chalk().default.bold.yellow(
|
||||
(0, _jestUtil().pluralize)('file', snapshotsFilesRemoved) +
|
||||
' obsolete'
|
||||
) + ', '
|
||||
: '') +
|
||||
(snapshotsFilesRemoved && snapshotsDidUpdate
|
||||
? _chalk().default.bold.green(
|
||||
(0, _jestUtil().pluralize)('file', snapshotsFilesRemoved) + ' removed'
|
||||
) + ', '
|
||||
: '') +
|
||||
(snapshotsUpdated
|
||||
? _chalk().default.bold.green(`${snapshotsUpdated} updated`) + ', '
|
||||
: '') +
|
||||
(snapshotsAdded
|
||||
? _chalk().default.bold.green(`${snapshotsAdded} written`) + ', '
|
||||
: '') +
|
||||
(snapshotsPassed
|
||||
? _chalk().default.bold.green(`${snapshotsPassed} passed`) + ', '
|
||||
: '') +
|
||||
`${snapshotsTotal} total`;
|
||||
const time = renderTime(runTime, estimatedTime, width);
|
||||
return [suites, tests, snapshots, time].join('\n');
|
||||
};
|
||||
|
||||
exports.getSummary = getSummary;
|
||||
|
||||
const renderTime = (runTime, estimatedTime, width) => {
|
||||
// If we are more than one second over the estimated time, highlight it.
|
||||
const renderedTime =
|
||||
estimatedTime && runTime >= estimatedTime + 1
|
||||
? _chalk().default.bold.yellow(runTime + 's')
|
||||
: runTime + 's';
|
||||
let time = _chalk().default.bold(`Time:`) + ` ${renderedTime}`;
|
||||
|
||||
if (runTime < estimatedTime) {
|
||||
time += `, estimated ${estimatedTime}s`;
|
||||
} // Only show a progress bar if the test run is actually going to take
|
||||
// some time.
|
||||
|
||||
if (estimatedTime > 2 && runTime < estimatedTime && width) {
|
||||
const availableWidth = Math.min(PROGRESS_BAR_WIDTH, width);
|
||||
const length = Math.min(
|
||||
Math.floor((runTime / estimatedTime) * availableWidth),
|
||||
availableWidth
|
||||
);
|
||||
|
||||
if (availableWidth >= 2) {
|
||||
time +=
|
||||
'\n' +
|
||||
_chalk()
|
||||
.default.green('█')
|
||||
.repeat(length) +
|
||||
_chalk()
|
||||
.default.white('█')
|
||||
.repeat(availableWidth - length);
|
||||
}
|
||||
}
|
||||
|
||||
return time;
|
||||
}; // word-wrap a string that contains ANSI escape sequences.
|
||||
// ANSI escape sequences do not add to the string length.
|
||||
|
||||
const wrapAnsiString = (string, terminalWidth) => {
|
||||
if (terminalWidth === 0) {
|
||||
// if the terminal width is zero, don't bother word-wrapping
|
||||
return string;
|
||||
}
|
||||
|
||||
const ANSI_REGEXP = /[\u001b\u009b]\[\d{1,2}m/g;
|
||||
const tokens = [];
|
||||
let lastIndex = 0;
|
||||
let match;
|
||||
|
||||
while ((match = ANSI_REGEXP.exec(string))) {
|
||||
const ansi = match[0];
|
||||
const index = match['index'];
|
||||
|
||||
if (index != lastIndex) {
|
||||
tokens.push(['string', string.slice(lastIndex, index)]);
|
||||
}
|
||||
|
||||
tokens.push(['ansi', ansi]);
|
||||
lastIndex = index + ansi.length;
|
||||
}
|
||||
|
||||
if (lastIndex != string.length - 1) {
|
||||
tokens.push(['string', string.slice(lastIndex, string.length)]);
|
||||
}
|
||||
|
||||
let lastLineLength = 0;
|
||||
return tokens
|
||||
.reduce(
|
||||
(lines, [kind, token]) => {
|
||||
if (kind === 'string') {
|
||||
if (lastLineLength + token.length > terminalWidth) {
|
||||
while (token.length) {
|
||||
const chunk = token.slice(0, terminalWidth - lastLineLength);
|
||||
const remaining = token.slice(
|
||||
terminalWidth - lastLineLength,
|
||||
token.length
|
||||
);
|
||||
lines[lines.length - 1] += chunk;
|
||||
lastLineLength += chunk.length;
|
||||
token = remaining;
|
||||
|
||||
if (token.length) {
|
||||
lines.push('');
|
||||
lastLineLength = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
lines[lines.length - 1] += token;
|
||||
lastLineLength += token.length;
|
||||
}
|
||||
} else {
|
||||
lines[lines.length - 1] += token;
|
||||
}
|
||||
|
||||
return lines;
|
||||
},
|
||||
['']
|
||||
)
|
||||
.join('\n');
|
||||
};
|
||||
|
||||
exports.wrapAnsiString = wrapAnsiString;
|
25
node_modules/@jest/reporters/build/verbose_reporter.d.ts
generated
vendored
Normal file
25
node_modules/@jest/reporters/build/verbose_reporter.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Config } from '@jest/types';
|
||||
import { AggregatedResult, AssertionResult, Suite, TestResult } from '@jest/test-result';
|
||||
import { Test } from './types';
|
||||
import DefaultReporter from './default_reporter';
|
||||
export default class VerboseReporter extends DefaultReporter {
|
||||
protected _globalConfig: Config.GlobalConfig;
|
||||
constructor(globalConfig: Config.GlobalConfig);
|
||||
static filterTestResults(testResults: Array<AssertionResult>): Array<AssertionResult>;
|
||||
static groupTestsBySuites(testResults: Array<AssertionResult>): Suite;
|
||||
onTestResult(test: Test, result: TestResult, aggregatedResults: AggregatedResult): void;
|
||||
private _logTestResults;
|
||||
private _logSuite;
|
||||
private _getIcon;
|
||||
private _logTest;
|
||||
private _logTests;
|
||||
private _logTodoOrPendingTest;
|
||||
private _logLine;
|
||||
}
|
||||
//# sourceMappingURL=verbose_reporter.d.ts.map
|
1
node_modules/@jest/reporters/build/verbose_reporter.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/reporters/build/verbose_reporter.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"verbose_reporter.d.ts","sourceRoot":"","sources":["../src/verbose_reporter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,KAAK,EACL,UAAU,EACX,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAC,IAAI,EAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAIjD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,eAAe;IAC1D,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC,YAAY,CAAC;gBAEjC,YAAY,EAAE,MAAM,CAAC,YAAY;IAK7C,MAAM,CAAC,iBAAiB,CACtB,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,GAClC,KAAK,CAAC,eAAe,CAAC;IAIzB,MAAM,CAAC,kBAAkB,CAAC,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC;IAqB7D,YAAY,CACV,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,UAAU,EAClB,iBAAiB,EAAE,gBAAgB;IAqBrC,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,SAAS;IAUjB,OAAO,CAAC,QAAQ;IAYhB,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,SAAS;IAgCjB,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,QAAQ;CAIjB"}
|
231
node_modules/@jest/reporters/build/verbose_reporter.js
generated
vendored
Normal file
231
node_modules/@jest/reporters/build/verbose_reporter.js
generated
vendored
Normal file
|
@ -0,0 +1,231 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function _jestUtil() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _default_reporter = _interopRequireDefault(require('./default_reporter'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
const ICONS = _jestUtil().specialChars.ICONS;
|
||||
|
||||
class VerboseReporter extends _default_reporter.default {
|
||||
constructor(globalConfig) {
|
||||
super(globalConfig);
|
||||
|
||||
_defineProperty(this, '_globalConfig', void 0);
|
||||
|
||||
this._globalConfig = globalConfig;
|
||||
}
|
||||
|
||||
static filterTestResults(testResults) {
|
||||
return testResults.filter(({status}) => status !== 'pending');
|
||||
}
|
||||
|
||||
static groupTestsBySuites(testResults) {
|
||||
const root = {
|
||||
suites: [],
|
||||
tests: [],
|
||||
title: ''
|
||||
};
|
||||
testResults.forEach(testResult => {
|
||||
let targetSuite = root; // Find the target suite for this test,
|
||||
// creating nested suites as necessary.
|
||||
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator = testResult.ancestorTitles[Symbol.iterator](), _step;
|
||||
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
|
||||
_iteratorNormalCompletion = true
|
||||
) {
|
||||
const title = _step.value;
|
||||
let matchingSuite = targetSuite.suites.find(s => s.title === title);
|
||||
|
||||
if (!matchingSuite) {
|
||||
matchingSuite = {
|
||||
suites: [],
|
||||
tests: [],
|
||||
title
|
||||
};
|
||||
targetSuite.suites.push(matchingSuite);
|
||||
}
|
||||
|
||||
targetSuite = matchingSuite;
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
targetSuite.tests.push(testResult);
|
||||
});
|
||||
return root;
|
||||
}
|
||||
|
||||
onTestResult(test, result, aggregatedResults) {
|
||||
super.testFinished(test.context.config, result, aggregatedResults);
|
||||
|
||||
if (!result.skipped) {
|
||||
this.printTestFileHeader(
|
||||
result.testFilePath,
|
||||
test.context.config,
|
||||
result
|
||||
);
|
||||
|
||||
if (!result.testExecError && !result.skipped) {
|
||||
this._logTestResults(result.testResults);
|
||||
}
|
||||
|
||||
this.printTestFileFailureMessage(
|
||||
result.testFilePath,
|
||||
test.context.config,
|
||||
result
|
||||
);
|
||||
}
|
||||
|
||||
super.forceFlushBufferedOutput();
|
||||
}
|
||||
|
||||
_logTestResults(testResults) {
|
||||
this._logSuite(VerboseReporter.groupTestsBySuites(testResults), 0);
|
||||
|
||||
this._logLine();
|
||||
}
|
||||
|
||||
_logSuite(suite, indentLevel) {
|
||||
if (suite.title) {
|
||||
this._logLine(suite.title, indentLevel);
|
||||
}
|
||||
|
||||
this._logTests(suite.tests, indentLevel + 1);
|
||||
|
||||
suite.suites.forEach(suite => this._logSuite(suite, indentLevel + 1));
|
||||
}
|
||||
|
||||
_getIcon(status) {
|
||||
if (status === 'failed') {
|
||||
return _chalk().default.red(ICONS.failed);
|
||||
} else if (status === 'pending') {
|
||||
return _chalk().default.yellow(ICONS.pending);
|
||||
} else if (status === 'todo') {
|
||||
return _chalk().default.magenta(ICONS.todo);
|
||||
} else {
|
||||
return _chalk().default.green(ICONS.success);
|
||||
}
|
||||
}
|
||||
|
||||
_logTest(test, indentLevel) {
|
||||
const status = this._getIcon(test.status);
|
||||
|
||||
const time = test.duration ? ` (${test.duration.toFixed(0)}ms)` : '';
|
||||
|
||||
this._logLine(
|
||||
status + ' ' + _chalk().default.dim(test.title + time),
|
||||
indentLevel
|
||||
);
|
||||
}
|
||||
|
||||
_logTests(tests, indentLevel) {
|
||||
if (this._globalConfig.expand) {
|
||||
tests.forEach(test => this._logTest(test, indentLevel));
|
||||
} else {
|
||||
const summedTests = tests.reduce(
|
||||
(result, test) => {
|
||||
if (test.status === 'pending') {
|
||||
result.pending.push(test);
|
||||
} else if (test.status === 'todo') {
|
||||
result.todo.push(test);
|
||||
} else {
|
||||
this._logTest(test, indentLevel);
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
{
|
||||
pending: [],
|
||||
todo: []
|
||||
}
|
||||
);
|
||||
|
||||
if (summedTests.pending.length > 0) {
|
||||
summedTests.pending.forEach(this._logTodoOrPendingTest(indentLevel));
|
||||
}
|
||||
|
||||
if (summedTests.todo.length > 0) {
|
||||
summedTests.todo.forEach(this._logTodoOrPendingTest(indentLevel));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_logTodoOrPendingTest(indentLevel) {
|
||||
return test => {
|
||||
const printedTestStatus =
|
||||
test.status === 'pending' ? 'skipped' : test.status;
|
||||
|
||||
const icon = this._getIcon(test.status);
|
||||
|
||||
const text = _chalk().default.dim(`${printedTestStatus} ${test.title}`);
|
||||
|
||||
this._logLine(`${icon} ${text}`, indentLevel);
|
||||
};
|
||||
}
|
||||
|
||||
_logLine(str, indentLevel) {
|
||||
const indentation = ' '.repeat(indentLevel || 0);
|
||||
this.log(indentation + (str || ''));
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = VerboseReporter;
|
11
node_modules/@jest/reporters/node_modules/slash/index.js
generated
vendored
Normal file
11
node_modules/@jest/reporters/node_modules/slash/index.js
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
'use strict';
|
||||
module.exports = input => {
|
||||
const isExtendedLengthPath = /^\\\\\?\\/.test(input);
|
||||
const hasNonAscii = /[^\u0000-\u0080]+/.test(input); // eslint-disable-line no-control-regex
|
||||
|
||||
if (isExtendedLengthPath || hasNonAscii) {
|
||||
return input;
|
||||
}
|
||||
|
||||
return input.replace(/\\/g, '/');
|
||||
};
|
9
node_modules/@jest/reporters/node_modules/slash/license
generated
vendored
Normal file
9
node_modules/@jest/reporters/node_modules/slash/license
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
38
node_modules/@jest/reporters/node_modules/slash/package.json
generated
vendored
Normal file
38
node_modules/@jest/reporters/node_modules/slash/package.json
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": "slash",
|
||||
"version": "2.0.0",
|
||||
"description": "Convert Windows backslash paths to slash paths",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/slash",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"path",
|
||||
"seperator",
|
||||
"sep",
|
||||
"slash",
|
||||
"backslash",
|
||||
"windows",
|
||||
"win"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz"
|
||||
,"_integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A=="
|
||||
,"_from": "slash@2.0.0"
|
||||
}
|
44
node_modules/@jest/reporters/node_modules/slash/readme.md
generated
vendored
Normal file
44
node_modules/@jest/reporters/node_modules/slash/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
# slash [](https://travis-ci.org/sindresorhus/slash)
|
||||
|
||||
> Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar`
|
||||
|
||||
[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths and don't contain any non-ascii characters.
|
||||
|
||||
This was created since the `path` methods in Node outputs `\\` paths on Windows.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install slash
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const path = require('path');
|
||||
const slash = require('slash');
|
||||
|
||||
const str = path.join('foo', 'bar');
|
||||
// Unix => foo/bar
|
||||
// Windows => foo\\bar
|
||||
|
||||
slash(str);
|
||||
// Unix => foo/bar
|
||||
// Windows => foo/bar
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### slash(path)
|
||||
|
||||
Type: `string`
|
||||
|
||||
Accepts a Windows backslash path and returns a slash path.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
64
node_modules/@jest/reporters/package.json
generated
vendored
Normal file
64
node_modules/@jest/reporters/package.json
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
"name": "@jest/reporters",
|
||||
"description": "Jest's reporters",
|
||||
"version": "24.8.0",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"dependencies": {
|
||||
"@jest/environment": "^24.8.0",
|
||||
"@jest/test-result": "^24.8.0",
|
||||
"@jest/transform": "^24.8.0",
|
||||
"@jest/types": "^24.8.0",
|
||||
"chalk": "^2.0.1",
|
||||
"exit": "^0.1.2",
|
||||
"glob": "^7.1.2",
|
||||
"istanbul-lib-coverage": "^2.0.2",
|
||||
"istanbul-lib-instrument": "^3.0.1",
|
||||
"istanbul-lib-report": "^2.0.4",
|
||||
"istanbul-lib-source-maps": "^3.0.1",
|
||||
"istanbul-reports": "^2.1.1",
|
||||
"jest-haste-map": "^24.8.0",
|
||||
"jest-resolve": "^24.8.0",
|
||||
"jest-runtime": "^24.8.0",
|
||||
"jest-util": "^24.8.0",
|
||||
"jest-worker": "^24.6.0",
|
||||
"node-notifier": "^5.2.1",
|
||||
"slash": "^2.0.0",
|
||||
"source-map": "^0.6.0",
|
||||
"string-length": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/exit": "^0.1.30",
|
||||
"@types/glob": "^7.1.1",
|
||||
"@types/istanbul-lib-coverage": "^2.0.0",
|
||||
"@types/istanbul-lib-instrument": "^1.7.2",
|
||||
"@types/istanbul-lib-report": "^1.1.0",
|
||||
"@types/istanbul-lib-source-maps": "^1.2.1",
|
||||
"@types/istanbul-reports": "^1.1.0",
|
||||
"@types/node-notifier": "^5.4.0",
|
||||
"@types/slash": "^2.0.0",
|
||||
"@types/string-length": "^2.0.0",
|
||||
"strip-ansi": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/jest",
|
||||
"directory": "packages/jest-reporters"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"homepage": "https://jestjs.io/",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "845728f24b3ef41e450595c384e9b5c9fdf248a4"
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.8.0.tgz"
|
||||
,"_integrity": "sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw=="
|
||||
,"_from": "@jest/reporters@24.8.0"
|
||||
}
|
17
node_modules/@jest/reporters/tsconfig.json
generated
vendored
Normal file
17
node_modules/@jest/reporters/tsconfig.json
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "build"
|
||||
},
|
||||
"references": [
|
||||
{"path": "../jest-environment"},
|
||||
{"path": "../jest-haste-map"},
|
||||
{"path": "../jest-resolve"},
|
||||
{"path": "../jest-runtime"},
|
||||
{"path": "../jest-test-result"},
|
||||
{"path": "../jest-types"},
|
||||
{"path": "../jest-util"},
|
||||
{"path": "../jest-worker"}
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue