mirror of
https://github.com/crazy-max/ghaction-upx.git
synced 2025-12-11 07:20:42 -07:00
Update node_modules
This commit is contained in:
21
node_modules/@jest/console/LICENSE
generated
vendored
Normal file
21
node_modules/@jest/console/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
||||
36
node_modules/@jest/console/build/BufferedConsole.d.ts
generated
vendored
Normal file
36
node_modules/@jest/console/build/BufferedConsole.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 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 { Console } from 'console';
|
||||
import { SourceMapRegistry } from '@jest/source-map';
|
||||
import { ConsoleBuffer, LogMessage, LogType } from './types';
|
||||
export default class BufferedConsole extends Console {
|
||||
private _buffer;
|
||||
private _counters;
|
||||
private _timers;
|
||||
private _groupDepth;
|
||||
private _getSourceMaps;
|
||||
constructor(getSourceMaps: () => SourceMapRegistry | null | undefined);
|
||||
static write(buffer: ConsoleBuffer, type: LogType, message: LogMessage, level?: number | null, sourceMaps?: SourceMapRegistry | null): ConsoleBuffer;
|
||||
private _log;
|
||||
assert(value: any, message?: string | Error): void;
|
||||
count(label?: string): void;
|
||||
countReset(label?: string): void;
|
||||
debug(firstArg: any, ...rest: Array<any>): void;
|
||||
dir(firstArg: any, ...rest: Array<any>): void;
|
||||
dirxml(firstArg: any, ...rest: Array<any>): void;
|
||||
error(firstArg: any, ...rest: Array<any>): void;
|
||||
group(title?: string, ...rest: Array<any>): void;
|
||||
groupCollapsed(title?: string, ...rest: Array<any>): void;
|
||||
groupEnd(): void;
|
||||
info(firstArg: any, ...rest: Array<any>): void;
|
||||
log(firstArg: any, ...rest: Array<any>): void;
|
||||
time(label?: string): void;
|
||||
timeEnd(label?: string): void;
|
||||
warn(firstArg: any, ...rest: Array<any>): void;
|
||||
getBuffer(): ConsoleBuffer | undefined;
|
||||
}
|
||||
//# sourceMappingURL=BufferedConsole.d.ts.map
|
||||
1
node_modules/@jest/console/build/BufferedConsole.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/console/build/BufferedConsole.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BufferedConsole.d.ts","sourceRoot":"","sources":["../src/BufferedConsole.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAC,iBAAiB,EAAc,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACL,aAAa,EAEb,UAAU,EAEV,OAAO,EACR,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAClD,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,OAAO,CAAY;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,cAAc,CAA6C;gBAEvD,aAAa,EAAE,MAAM,iBAAiB,GAAG,IAAI,GAAG,SAAS;IAgBrE,MAAM,CAAC,KAAK,CACV,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,UAAU,EACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,UAAU,CAAC,EAAE,iBAAiB,GAAG,IAAI;IAcvC,OAAO,CAAC,IAAI;IAUZ,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK;IAQ3C,KAAK,CAAC,KAAK,GAAE,MAAkB;IAQ/B,UAAU,CAAC,KAAK,GAAE,MAAkB;IAIpC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIxC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAItC,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIzC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIxC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAQzC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAQlD,QAAQ;IAMR,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIvC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAItC,IAAI,CAAC,KAAK,GAAE,MAAkB;IAQ9B,OAAO,CAAC,KAAK,GAAE,MAAkB;IAWjC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIvC,SAAS;CAGV"}
|
||||
232
node_modules/@jest/console/build/BufferedConsole.js
generated
vendored
Normal file
232
node_modules/@jest/console/build/BufferedConsole.js
generated
vendored
Normal file
@@ -0,0 +1,232 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _assert() {
|
||||
const data = _interopRequireDefault(require('assert'));
|
||||
|
||||
_assert = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _console() {
|
||||
const data = require('console');
|
||||
|
||||
_console = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _util() {
|
||||
const data = require('util');
|
||||
|
||||
_util = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _sourceMap() {
|
||||
const data = require('@jest/source-map');
|
||||
|
||||
_sourceMap = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
class BufferedConsole extends _console().Console {
|
||||
constructor(getSourceMaps) {
|
||||
const buffer = [];
|
||||
super({
|
||||
write: message => {
|
||||
BufferedConsole.write(buffer, 'log', message, null, getSourceMaps());
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
_defineProperty(this, '_buffer', void 0);
|
||||
|
||||
_defineProperty(this, '_counters', void 0);
|
||||
|
||||
_defineProperty(this, '_timers', void 0);
|
||||
|
||||
_defineProperty(this, '_groupDepth', void 0);
|
||||
|
||||
_defineProperty(this, '_getSourceMaps', void 0);
|
||||
|
||||
this._getSourceMaps = getSourceMaps;
|
||||
this._buffer = buffer;
|
||||
this._counters = {};
|
||||
this._timers = {};
|
||||
this._groupDepth = 0;
|
||||
}
|
||||
|
||||
static write(buffer, type, message, level, sourceMaps) {
|
||||
const callsite = (0, _sourceMap().getCallsite)(
|
||||
level != null ? level : 2,
|
||||
sourceMaps
|
||||
);
|
||||
const origin = callsite.getFileName() + ':' + callsite.getLineNumber();
|
||||
buffer.push({
|
||||
message,
|
||||
origin,
|
||||
type
|
||||
});
|
||||
return buffer;
|
||||
}
|
||||
|
||||
_log(type, message) {
|
||||
BufferedConsole.write(
|
||||
this._buffer,
|
||||
type,
|
||||
' '.repeat(this._groupDepth) + message,
|
||||
3,
|
||||
this._getSourceMaps()
|
||||
);
|
||||
}
|
||||
|
||||
assert(value, message) {
|
||||
try {
|
||||
(0, _assert().default)(value, message);
|
||||
} catch (error) {
|
||||
this._log('assert', error.toString());
|
||||
}
|
||||
}
|
||||
|
||||
count(label = 'default') {
|
||||
if (!this._counters[label]) {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
|
||||
this._log(
|
||||
'count',
|
||||
(0, _util().format)(`${label}: ${++this._counters[label]}`)
|
||||
);
|
||||
}
|
||||
|
||||
countReset(label = 'default') {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
|
||||
debug(firstArg, ...rest) {
|
||||
this._log('debug', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
dir(firstArg, ...rest) {
|
||||
this._log('dir', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
dirxml(firstArg, ...rest) {
|
||||
this._log('dirxml', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
error(firstArg, ...rest) {
|
||||
this._log('error', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
group(title, ...rest) {
|
||||
this._groupDepth++;
|
||||
|
||||
if (title || rest.length > 0) {
|
||||
this._log(
|
||||
'group',
|
||||
_chalk().default.bold((0, _util().format)(title, ...rest))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
groupCollapsed(title, ...rest) {
|
||||
this._groupDepth++;
|
||||
|
||||
if (title || rest.length > 0) {
|
||||
this._log(
|
||||
'groupCollapsed',
|
||||
_chalk().default.bold((0, _util().format)(title, ...rest))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
groupEnd() {
|
||||
if (this._groupDepth > 0) {
|
||||
this._groupDepth--;
|
||||
}
|
||||
}
|
||||
|
||||
info(firstArg, ...rest) {
|
||||
this._log('info', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
log(firstArg, ...rest) {
|
||||
this._log('log', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
time(label = 'default') {
|
||||
if (this._timers[label]) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._timers[label] = new Date();
|
||||
}
|
||||
|
||||
timeEnd(label = 'default') {
|
||||
const startTime = this._timers[label];
|
||||
|
||||
if (startTime) {
|
||||
const endTime = new Date();
|
||||
const time = endTime.getTime() - startTime.getTime();
|
||||
|
||||
this._log('time', (0, _util().format)(`${label}: ${time}ms`));
|
||||
|
||||
delete this._timers[label];
|
||||
}
|
||||
}
|
||||
|
||||
warn(firstArg, ...rest) {
|
||||
this._log('warn', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
getBuffer() {
|
||||
return this._buffer.length ? this._buffer : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = BufferedConsole;
|
||||
39
node_modules/@jest/console/build/CustomConsole.d.ts
generated
vendored
Normal file
39
node_modules/@jest/console/build/CustomConsole.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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { Console } from 'console';
|
||||
import { LogMessage, LogType } from './types';
|
||||
declare type Formatter = (type: LogType, message: LogMessage) => string;
|
||||
export default class CustomConsole extends Console {
|
||||
private _stdout;
|
||||
private _stderr;
|
||||
private _formatBuffer;
|
||||
private _counters;
|
||||
private _timers;
|
||||
private _groupDepth;
|
||||
constructor(stdout: NodeJS.WriteStream, stderr: NodeJS.WriteStream, formatBuffer?: Formatter);
|
||||
private _log;
|
||||
private _logError;
|
||||
assert(value: any, message?: string | Error): void;
|
||||
count(label?: string): void;
|
||||
countReset(label?: string): void;
|
||||
debug(firstArg: any, ...args: Array<any>): void;
|
||||
dir(firstArg: any, ...args: Array<any>): void;
|
||||
dirxml(firstArg: any, ...args: Array<any>): void;
|
||||
error(firstArg: any, ...args: Array<any>): void;
|
||||
group(title?: string, ...args: Array<any>): void;
|
||||
groupCollapsed(title?: string, ...args: Array<any>): void;
|
||||
groupEnd(): void;
|
||||
info(firstArg: any, ...args: Array<any>): void;
|
||||
log(firstArg: any, ...args: Array<any>): void;
|
||||
time(label?: string): void;
|
||||
timeEnd(label?: string): void;
|
||||
warn(firstArg: any, ...args: Array<any>): void;
|
||||
getBuffer(): undefined;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=CustomConsole.d.ts.map
|
||||
1
node_modules/@jest/console/build/CustomConsole.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/console/build/CustomConsole.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CustomConsole.d.ts","sourceRoot":"","sources":["../src/CustomConsole.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAIH,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAc,UAAU,EAAa,OAAO,EAAC,MAAM,SAAS,CAAC;AAEpE,aAAK,SAAS,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,KAAK,MAAM,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,OAAO;IAChD,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,OAAO,CAAY;IAC3B,OAAO,CAAC,WAAW,CAAS;gBAG1B,MAAM,EAAE,MAAM,CAAC,WAAW,EAC1B,MAAM,EAAE,MAAM,CAAC,WAAW,EAC1B,YAAY,GAAE,SAAuC;IAWvD,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,SAAS;IAOjB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK;IAQ3C,KAAK,CAAC,KAAK,GAAE,MAAkB;IAQ/B,UAAU,CAAC,KAAK,GAAE,MAAkB;IAIpC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIxC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAItC,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIzC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIxC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAQzC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAQlD,QAAQ;IAMR,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIvC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAItC,IAAI,CAAC,KAAK,GAAE,MAAkB;IAQ9B,OAAO,CAAC,KAAK,GAAE,MAAkB;IAWjC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIvC,SAAS;CAGV"}
|
||||
219
node_modules/@jest/console/build/CustomConsole.js
generated
vendored
Normal file
219
node_modules/@jest/console/build/CustomConsole.js
generated
vendored
Normal file
@@ -0,0 +1,219 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _assert() {
|
||||
const data = _interopRequireDefault(require('assert'));
|
||||
|
||||
_assert = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _util() {
|
||||
const data = require('util');
|
||||
|
||||
_util = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _console() {
|
||||
const data = require('console');
|
||||
|
||||
_console = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
class CustomConsole extends _console().Console {
|
||||
constructor(stdout, stderr, formatBuffer = (_type, message) => message) {
|
||||
super(stdout, stderr);
|
||||
|
||||
_defineProperty(this, '_stdout', void 0);
|
||||
|
||||
_defineProperty(this, '_stderr', void 0);
|
||||
|
||||
_defineProperty(this, '_formatBuffer', void 0);
|
||||
|
||||
_defineProperty(this, '_counters', void 0);
|
||||
|
||||
_defineProperty(this, '_timers', void 0);
|
||||
|
||||
_defineProperty(this, '_groupDepth', void 0);
|
||||
|
||||
this._stdout = stdout;
|
||||
this._stderr = stderr;
|
||||
this._formatBuffer = formatBuffer;
|
||||
this._counters = {};
|
||||
this._timers = {};
|
||||
this._groupDepth = 0;
|
||||
}
|
||||
|
||||
_log(type, message) {
|
||||
(0, _jestUtil().clearLine)(this._stdout);
|
||||
super.log(
|
||||
this._formatBuffer(type, ' '.repeat(this._groupDepth) + message)
|
||||
);
|
||||
}
|
||||
|
||||
_logError(type, message) {
|
||||
(0, _jestUtil().clearLine)(this._stderr);
|
||||
super.error(
|
||||
this._formatBuffer(type, ' '.repeat(this._groupDepth) + message)
|
||||
);
|
||||
}
|
||||
|
||||
assert(value, message) {
|
||||
try {
|
||||
(0, _assert().default)(value, message);
|
||||
} catch (error) {
|
||||
this._logError('assert', error.toString());
|
||||
}
|
||||
}
|
||||
|
||||
count(label = 'default') {
|
||||
if (!this._counters[label]) {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
|
||||
this._log(
|
||||
'count',
|
||||
(0, _util().format)(`${label}: ${++this._counters[label]}`)
|
||||
);
|
||||
}
|
||||
|
||||
countReset(label = 'default') {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
|
||||
debug(firstArg, ...args) {
|
||||
this._log('debug', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
dir(firstArg, ...args) {
|
||||
this._log('dir', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
dirxml(firstArg, ...args) {
|
||||
this._log('dirxml', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
error(firstArg, ...args) {
|
||||
this._logError('error', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
group(title, ...args) {
|
||||
this._groupDepth++;
|
||||
|
||||
if (title || args.length > 0) {
|
||||
this._log(
|
||||
'group',
|
||||
_chalk().default.bold((0, _util().format)(title, ...args))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
groupCollapsed(title, ...args) {
|
||||
this._groupDepth++;
|
||||
|
||||
if (title || args.length > 0) {
|
||||
this._log(
|
||||
'groupCollapsed',
|
||||
_chalk().default.bold((0, _util().format)(title, ...args))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
groupEnd() {
|
||||
if (this._groupDepth > 0) {
|
||||
this._groupDepth--;
|
||||
}
|
||||
}
|
||||
|
||||
info(firstArg, ...args) {
|
||||
this._log('info', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
log(firstArg, ...args) {
|
||||
this._log('log', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
time(label = 'default') {
|
||||
if (this._timers[label]) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._timers[label] = new Date();
|
||||
}
|
||||
|
||||
timeEnd(label = 'default') {
|
||||
const startTime = this._timers[label];
|
||||
|
||||
if (startTime) {
|
||||
const endTime = new Date().getTime();
|
||||
const time = endTime - startTime.getTime();
|
||||
|
||||
this._log('time', (0, _util().format)(`${label}: ${time}ms`));
|
||||
|
||||
delete this._timers[label];
|
||||
}
|
||||
}
|
||||
|
||||
warn(firstArg, ...args) {
|
||||
this._logError('warn', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
getBuffer() {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = CustomConsole;
|
||||
23
node_modules/@jest/console/build/NullConsole.d.ts
generated
vendored
Normal file
23
node_modules/@jest/console/build/NullConsole.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* 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 CustomConsole from './CustomConsole';
|
||||
export default class NullConsole extends CustomConsole {
|
||||
assert(): void;
|
||||
debug(): void;
|
||||
dir(): void;
|
||||
error(): void;
|
||||
info(): void;
|
||||
log(): void;
|
||||
time(): void;
|
||||
timeEnd(): void;
|
||||
trace(): void;
|
||||
warn(): void;
|
||||
group(): void;
|
||||
groupCollapsed(): void;
|
||||
groupEnd(): void;
|
||||
}
|
||||
//# sourceMappingURL=NullConsole.d.ts.map
|
||||
1
node_modules/@jest/console/build/NullConsole.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/console/build/NullConsole.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"NullConsole.d.ts","sourceRoot":"","sources":["../src/NullConsole.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,aAAa;IACpD,MAAM;IACN,KAAK;IACL,GAAG;IACH,KAAK;IACL,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,OAAO;IACP,KAAK;IACL,IAAI;IACJ,KAAK;IACL,cAAc;IACd,QAAQ;CACT"}
|
||||
48
node_modules/@jest/console/build/NullConsole.js
generated
vendored
Normal file
48
node_modules/@jest/console/build/NullConsole.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _CustomConsole = _interopRequireDefault(require('./CustomConsole'));
|
||||
|
||||
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.
|
||||
*/
|
||||
class NullConsole extends _CustomConsole.default {
|
||||
assert() {}
|
||||
|
||||
debug() {}
|
||||
|
||||
dir() {}
|
||||
|
||||
error() {}
|
||||
|
||||
info() {}
|
||||
|
||||
log() {}
|
||||
|
||||
time() {}
|
||||
|
||||
timeEnd() {}
|
||||
|
||||
trace() {}
|
||||
|
||||
warn() {}
|
||||
|
||||
group() {}
|
||||
|
||||
groupCollapsed() {}
|
||||
|
||||
groupEnd() {}
|
||||
}
|
||||
|
||||
exports.default = NullConsole;
|
||||
10
node_modules/@jest/console/build/getConsoleOutput.d.ts
generated
vendored
Normal file
10
node_modules/@jest/console/build/getConsoleOutput.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* 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 { ConsoleBuffer } from './types';
|
||||
declare const _default: (root: string, verbose: boolean, buffer: ConsoleBuffer) => string;
|
||||
export default _default;
|
||||
//# sourceMappingURL=getConsoleOutput.d.ts.map
|
||||
1
node_modules/@jest/console/build/getConsoleOutput.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/console/build/getConsoleOutput.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getConsoleOutput.d.ts","sourceRoot":"","sources":["../src/getConsoleOutput.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;;AAEtC,wBA+BE"}
|
||||
122
node_modules/@jest/console/build/getConsoleOutput.js
generated
vendored
Normal file
122
node_modules/@jest/console/build/getConsoleOutput.js
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require('path'));
|
||||
|
||||
path = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _slash() {
|
||||
const data = _interopRequireDefault(require('slash'));
|
||||
|
||||
_slash = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function() {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
var _default = (root, verbose, buffer) => {
|
||||
const TITLE_INDENT = verbose ? ' ' : ' ';
|
||||
const CONSOLE_INDENT = TITLE_INDENT + ' ';
|
||||
return buffer.reduce((output, {type, message, origin}) => {
|
||||
origin = (0, _slash().default)(path().relative(root, origin));
|
||||
message = message
|
||||
.split(/\n/)
|
||||
.map(line => CONSOLE_INDENT + line)
|
||||
.join('\n');
|
||||
let typeMessage = 'console.' + type;
|
||||
|
||||
if (type === 'warn') {
|
||||
message = _chalk().default.yellow(message);
|
||||
typeMessage = _chalk().default.yellow(typeMessage);
|
||||
} else if (type === 'error') {
|
||||
message = _chalk().default.red(message);
|
||||
typeMessage = _chalk().default.red(typeMessage);
|
||||
}
|
||||
|
||||
return (
|
||||
output +
|
||||
TITLE_INDENT +
|
||||
_chalk().default.dim(typeMessage) +
|
||||
' ' +
|
||||
_chalk().default.dim(origin) +
|
||||
'\n' +
|
||||
message +
|
||||
'\n'
|
||||
);
|
||||
}, '');
|
||||
};
|
||||
|
||||
exports.default = _default;
|
||||
12
node_modules/@jest/console/build/index.d.ts
generated
vendored
Normal file
12
node_modules/@jest/console/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 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 BufferedConsole } from './BufferedConsole';
|
||||
export { default as CustomConsole } from './CustomConsole';
|
||||
export { default as NullConsole } from './NullConsole';
|
||||
export { default as getConsoleOutput } from './getConsoleOutput';
|
||||
export { ConsoleBuffer, LogMessage, LogType } from './types';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@jest/console/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/console/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,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,SAAS,CAAC"}
|
||||
61
node_modules/@jest/console/build/index.js
generated
vendored
Normal file
61
node_modules/@jest/console/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'BufferedConsole', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _BufferedConsole.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'CustomConsole', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _CustomConsole.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'NullConsole', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _NullConsole.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'getConsoleOutput', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _getConsoleOutput.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'ConsoleBuffer', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.ConsoleBuffer;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'LogMessage', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.LogMessage;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'LogType', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.LogType;
|
||||
}
|
||||
});
|
||||
|
||||
var _BufferedConsole = _interopRequireDefault(require('./BufferedConsole'));
|
||||
|
||||
var _CustomConsole = _interopRequireDefault(require('./CustomConsole'));
|
||||
|
||||
var _NullConsole = _interopRequireDefault(require('./NullConsole'));
|
||||
|
||||
var _getConsoleOutput = _interopRequireDefault(require('./getConsoleOutput'));
|
||||
|
||||
var _types = require('./types');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
21
node_modules/@jest/console/build/types.d.ts
generated
vendored
Normal file
21
node_modules/@jest/console/build/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* 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 declare type LogMessage = string;
|
||||
export declare type LogEntry = {
|
||||
message: LogMessage;
|
||||
origin: string;
|
||||
type: LogType;
|
||||
};
|
||||
export declare type LogCounters = {
|
||||
[label: string]: number;
|
||||
};
|
||||
export declare type LogTimers = {
|
||||
[label: string]: Date;
|
||||
};
|
||||
export declare type LogType = 'assert' | 'count' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'info' | 'log' | 'time' | 'warn';
|
||||
export declare type ConsoleBuffer = Array<LogEntry>;
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
1
node_modules/@jest/console/build/types.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/console/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,oBAAY,UAAU,GAAG,MAAM,CAAC;AAEhC,oBAAY,QAAQ,GAAG;IACrB,OAAO,EAAE,UAAU,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,oBAAY,SAAS,GAAG;IACtB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,oBAAY,OAAO,GACf,QAAQ,GACR,OAAO,GACP,OAAO,GACP,KAAK,GACL,QAAQ,GACR,OAAO,GACP,OAAO,GACP,gBAAgB,GAChB,MAAM,GACN,KAAK,GACL,MAAM,GACN,MAAM,CAAC;AAEX,oBAAY,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC"}
|
||||
1
node_modules/@jest/console/build/types.js
generated
vendored
Normal file
1
node_modules/@jest/console/build/types.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
'use strict';
|
||||
57
node_modules/@jest/console/package.json
generated
vendored
Normal file
57
node_modules/@jest/console/package.json
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"_from": "@jest/console@^25.1.0",
|
||||
"_id": "@jest/console@25.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-3P1DpqAMK/L07ag/Y9/Jup5iDEG9P4pRAuZiMQnU0JB3UOvCyYCjCoxr7sIA80SeyUCUKrr24fKAxVpmBgQonA==",
|
||||
"_location": "/@jest/console",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@jest/console@^25.1.0",
|
||||
"name": "@jest/console",
|
||||
"escapedName": "@jest%2fconsole",
|
||||
"scope": "@jest",
|
||||
"rawSpec": "^25.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^25.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@jest/test-result",
|
||||
"/jest-runner",
|
||||
"/jest-runtime"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@jest/console/-/console-25.1.0.tgz",
|
||||
"_shasum": "1fc765d44a1e11aec5029c08e798246bd37075ab",
|
||||
"_spec": "@jest/console@^25.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx/node_modules/jest-runtime",
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@jest/source-map": "^25.1.0",
|
||||
"chalk": "^3.0.0",
|
||||
"jest-util": "^25.1.0",
|
||||
"slash": "^3.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"engines": {
|
||||
"node": ">= 8.3"
|
||||
},
|
||||
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638",
|
||||
"homepage": "https://github.com/facebook/jest#readme",
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "@jest/console",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-console"
|
||||
},
|
||||
"types": "build/index.d.ts",
|
||||
"version": "25.1.0"
|
||||
}
|
||||
21
node_modules/@jest/environment/LICENSE
generated
vendored
Normal file
21
node_modules/@jest/environment/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
||||
266
node_modules/@jest/environment/build/index.d.ts
generated
vendored
Normal file
266
node_modules/@jest/environment/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,266 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
/// <reference types="jest" />
|
||||
import { Context, Script } from 'vm';
|
||||
import { Circus, Config, Global } from '@jest/types';
|
||||
import jestMock = require('jest-mock');
|
||||
import { JestFakeTimers as LegacyFakeTimers, LolexFakeTimers } from '@jest/fake-timers';
|
||||
declare type JestMockFn = typeof jestMock.fn;
|
||||
declare type JestMockSpyOn = typeof jestMock.spyOn;
|
||||
export declare type EnvironmentContext = Partial<{
|
||||
console: Console;
|
||||
docblockPragmas: Record<string, string | Array<string>>;
|
||||
testPath: Config.Path;
|
||||
}>;
|
||||
export declare type ModuleWrapper = (this: Module['exports'], module: Module, exports: Module['exports'], require: Module['require'], __dirname: string, __filename: Module['filename'], global: Global.Global, jest: Jest, ...extraGlobals: Array<Global.Global[keyof Global.Global]>) => unknown;
|
||||
export declare class JestEnvironment {
|
||||
constructor(config: Config.ProjectConfig, context?: EnvironmentContext);
|
||||
global: Global.Global;
|
||||
fakeTimers: LegacyFakeTimers<unknown> | null;
|
||||
fakeTimersLolex: LolexFakeTimers | null;
|
||||
moduleMocker: jestMock.ModuleMocker | null;
|
||||
/**
|
||||
* @deprecated implement getVmContext instead
|
||||
*/
|
||||
runScript<T = unknown>(script: Script): T | null;
|
||||
getVmContext?(): Context | null;
|
||||
setup(): Promise<void>;
|
||||
teardown(): Promise<void>;
|
||||
handleTestEvent?(event: Circus.Event, state: Circus.State): void;
|
||||
}
|
||||
export declare type Module = NodeModule;
|
||||
export interface LocalModuleRequire extends NodeRequire {
|
||||
requireActual(moduleName: string): unknown;
|
||||
requireMock(moduleName: string): unknown;
|
||||
}
|
||||
export interface Jest {
|
||||
/**
|
||||
* Provides a way to add Jasmine-compatible matchers into your Jest context.
|
||||
*
|
||||
* @deprecated Use `expect.extend` instead
|
||||
*/
|
||||
addMatchers(matchers: Record<string, any>): void;
|
||||
/**
|
||||
* Advances all timers by the needed milliseconds so that only the next timeouts/intervals will run.
|
||||
* Optionally, you can provide steps, so it will run steps amount of next timeouts/intervals.
|
||||
*/
|
||||
advanceTimersToNextTimer(steps?: number): void;
|
||||
/**
|
||||
* Disables automatic mocking in the module loader.
|
||||
*/
|
||||
autoMockOff(): Jest;
|
||||
/**
|
||||
* Enables automatic mocking in the module loader.
|
||||
*/
|
||||
autoMockOn(): Jest;
|
||||
/**
|
||||
* Clears the mock.calls and mock.instances properties of all mocks.
|
||||
* Equivalent to calling .mockClear() on every mocked function.
|
||||
*/
|
||||
clearAllMocks(): Jest;
|
||||
/**
|
||||
* Removes any pending timers from the timer system. If any timers have been
|
||||
* scheduled, they will be cleared and will never have the opportunity to
|
||||
* execute in the future.
|
||||
*/
|
||||
clearAllTimers(): void;
|
||||
/**
|
||||
* Indicates that the module system should never return a mocked version
|
||||
* of the specified module, including all of the specified module's
|
||||
* dependencies.
|
||||
*/
|
||||
deepUnmock(moduleName: string): Jest;
|
||||
/**
|
||||
* Disables automatic mocking in the module loader.
|
||||
*
|
||||
* After this method is called, all `require()`s will return the real
|
||||
* versions of each module (rather than a mocked version).
|
||||
*/
|
||||
disableAutomock(): Jest;
|
||||
/**
|
||||
* When using `babel-jest`, calls to mock will automatically be hoisted to
|
||||
* the top of the code block. Use this method if you want to explicitly avoid
|
||||
* this behavior.
|
||||
*/
|
||||
doMock(moduleName: string, moduleFactory?: () => unknown): Jest;
|
||||
/**
|
||||
* Indicates that the module system should never return a mocked version
|
||||
* of the specified module from require() (e.g. that it should always return
|
||||
* the real module).
|
||||
*/
|
||||
dontMock(moduleName: string): Jest;
|
||||
/**
|
||||
* Enables automatic mocking in the module loader.
|
||||
*/
|
||||
enableAutomock(): Jest;
|
||||
/**
|
||||
* Creates a mock function. Optionally takes a mock implementation.
|
||||
*/
|
||||
fn: JestMockFn;
|
||||
/**
|
||||
* Given the name of a module, use the automatic mocking system to generate a
|
||||
* mocked version of the module for you.
|
||||
*
|
||||
* This is useful when you want to create a manual mock that extends the
|
||||
* automatic mock's behavior.
|
||||
*/
|
||||
genMockFromModule(moduleName: string): unknown;
|
||||
/**
|
||||
* Determines if the given function is a mocked function.
|
||||
*/
|
||||
isMockFunction(fn: Function): fn is ReturnType<JestMockFn>;
|
||||
/**
|
||||
* Mocks a module with an auto-mocked version when it is being required.
|
||||
*/
|
||||
mock(moduleName: string, moduleFactory?: () => unknown, options?: {
|
||||
virtual?: boolean;
|
||||
}): Jest;
|
||||
/**
|
||||
* Returns the actual module instead of a mock, bypassing all checks on
|
||||
* whether the module should receive a mock implementation or not.
|
||||
*
|
||||
* @example
|
||||
```
|
||||
jest.mock('../myModule', () => {
|
||||
// Require the original module to not be mocked...
|
||||
const originalModule = jest.requireActual(moduleName);
|
||||
return {
|
||||
__esModule: true, // Use it when dealing with esModules
|
||||
...originalModule,
|
||||
getRandom: jest.fn().mockReturnValue(10),
|
||||
};
|
||||
});
|
||||
|
||||
const getRandom = require('../myModule').getRandom;
|
||||
|
||||
getRandom(); // Always returns 10
|
||||
```
|
||||
*/
|
||||
requireActual: (moduleName: string) => unknown;
|
||||
/**
|
||||
* Returns a mock module instead of the actual module, bypassing all checks
|
||||
* on whether the module should be required normally or not.
|
||||
*/
|
||||
requireMock: (moduleName: string) => unknown;
|
||||
/**
|
||||
* Resets the state of all mocks.
|
||||
* Equivalent to calling .mockReset() on every mocked function.
|
||||
*/
|
||||
resetAllMocks(): Jest;
|
||||
/**
|
||||
* Resets the module registry - the cache of all required modules. This is
|
||||
* useful to isolate modules where local state might conflict between tests.
|
||||
*
|
||||
* @deprecated Use `jest.resetModules()`
|
||||
*/
|
||||
resetModuleRegistry(): Jest;
|
||||
/**
|
||||
* Resets the module registry - the cache of all required modules. This is
|
||||
* useful to isolate modules where local state might conflict between tests.
|
||||
*/
|
||||
resetModules(): Jest;
|
||||
/**
|
||||
* Restores all mocks back to their original value. Equivalent to calling
|
||||
* `.mockRestore` on every mocked function.
|
||||
*
|
||||
* Beware that jest.restoreAllMocks() only works when the mock was created with
|
||||
* jest.spyOn; other mocks will require you to manually restore them.
|
||||
*/
|
||||
restoreAllMocks(): Jest;
|
||||
/**
|
||||
* Runs failed tests n-times until they pass or until the max number of
|
||||
* retries is exhausted. This only works with `jest-circus`!
|
||||
*/
|
||||
retryTimes(numRetries: number): Jest;
|
||||
/**
|
||||
* Exhausts tasks queued by setImmediate().
|
||||
*/
|
||||
runAllImmediates(): void;
|
||||
/**
|
||||
* Exhausts the micro-task queue (usually interfaced in node via
|
||||
* process.nextTick).
|
||||
*/
|
||||
runAllTicks(): void;
|
||||
/**
|
||||
* Exhausts the macro-task queue (i.e., all tasks queued by setTimeout()
|
||||
* and setInterval()).
|
||||
*/
|
||||
runAllTimers(): void;
|
||||
/**
|
||||
* Executes only the macro-tasks that are currently pending (i.e., only the
|
||||
* tasks that have been queued by setTimeout() or setInterval() up to this
|
||||
* point). If any of the currently pending macro-tasks schedule new
|
||||
* macro-tasks, those new tasks will not be executed by this call.
|
||||
*/
|
||||
runOnlyPendingTimers(): void;
|
||||
/**
|
||||
* Advances all timers by msToRun milliseconds. All pending "macro-tasks"
|
||||
* that have been queued via setTimeout() or setInterval(), and would be
|
||||
* executed within this timeframe will be executed.
|
||||
*/
|
||||
advanceTimersByTime(msToRun: number): void;
|
||||
/**
|
||||
* Executes only the macro task queue (i.e. all tasks queued by setTimeout()
|
||||
* or setInterval() and setImmediate()).
|
||||
*
|
||||
* @deprecated Use `jest.advanceTimersByTime()`
|
||||
*/
|
||||
runTimersToTime(msToRun: number): void;
|
||||
/**
|
||||
* Returns the number of fake timers still left to run.
|
||||
*/
|
||||
getTimerCount(): number;
|
||||
/**
|
||||
* Explicitly supplies the mock object that the module system should return
|
||||
* for the specified module.
|
||||
*
|
||||
* Note It is recommended to use `jest.mock()` instead. The `jest.mock`
|
||||
* API's second argument is a module factory instead of the expected
|
||||
* exported module object.
|
||||
*/
|
||||
setMock(moduleName: string, moduleExports: unknown): Jest;
|
||||
/**
|
||||
* Set the default timeout interval for tests and before/after hooks in
|
||||
* milliseconds.
|
||||
*
|
||||
* Note: The default timeout interval is 5 seconds if this method is not
|
||||
* called.
|
||||
*/
|
||||
setTimeout(timeout: number): Jest;
|
||||
/**
|
||||
* Creates a mock function similar to `jest.fn` but also tracks calls to
|
||||
* `object[methodName]`.
|
||||
*
|
||||
* Note: By default, jest.spyOn also calls the spied method. This is
|
||||
* different behavior from most other test libraries.
|
||||
*/
|
||||
spyOn: JestMockSpyOn;
|
||||
/**
|
||||
* Indicates that the module system should never return a mocked version of
|
||||
* the specified module from require() (e.g. that it should always return the
|
||||
* real module).
|
||||
*/
|
||||
unmock(moduleName: string): Jest;
|
||||
/**
|
||||
* Instructs Jest to use fake versions of the standard timer functions.
|
||||
*/
|
||||
useFakeTimers(): Jest;
|
||||
/**
|
||||
* Instructs Jest to use the real versions of the standard timer functions.
|
||||
*/
|
||||
useRealTimers(): Jest;
|
||||
/**
|
||||
* `jest.isolateModules(fn)` goes a step further than `jest.resetModules()`
|
||||
* and creates a sandbox registry for the modules that are loaded inside
|
||||
* the callback function. This is useful to isolate specific modules for
|
||||
* every test so that local module state doesn't conflict between tests.
|
||||
*/
|
||||
isolateModules(fn: () => void): Jest;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@jest/environment/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/environment/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":"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"}
|
||||
29
node_modules/@jest/environment/build/index.js
generated
vendored
Normal file
29
node_modules/@jest/environment/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
function _jestMock() {
|
||||
const data = _interopRequireDefault(require('jest-mock'));
|
||||
|
||||
_jestMock = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
61
node_modules/@jest/environment/package.json
generated
vendored
Normal file
61
node_modules/@jest/environment/package.json
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"_from": "@jest/environment@^25.1.0",
|
||||
"_id": "@jest/environment@25.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-cTpUtsjU4cum53VqBDlcW0E4KbQF03Cn0jckGPW/5rrE9tb+porD3+hhLtHAwhthsqfyF+bizyodTlsRA++sHg==",
|
||||
"_location": "/@jest/environment",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@jest/environment@^25.1.0",
|
||||
"name": "@jest/environment",
|
||||
"escapedName": "@jest%2fenvironment",
|
||||
"scope": "@jest",
|
||||
"rawSpec": "^25.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^25.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/jest-environment-jsdom",
|
||||
"/jest-environment-node",
|
||||
"/jest-jasmine2",
|
||||
"/jest-runner",
|
||||
"/jest-runtime"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@jest/environment/-/environment-25.1.0.tgz",
|
||||
"_shasum": "4a97f64770c9d075f5d2b662b5169207f0a3f787",
|
||||
"_spec": "@jest/environment@^25.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx/node_modules/jest-runtime",
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@jest/fake-timers": "^25.1.0",
|
||||
"@jest/types": "^25.1.0",
|
||||
"jest-mock": "^25.1.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"devDependencies": {
|
||||
"@types/node": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.3"
|
||||
},
|
||||
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638",
|
||||
"homepage": "https://github.com/facebook/jest#readme",
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "@jest/environment",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-environment"
|
||||
},
|
||||
"types": "build/index.d.ts",
|
||||
"version": "25.1.0"
|
||||
}
|
||||
21
node_modules/@jest/fake-timers/LICENSE
generated
vendored
Normal file
21
node_modules/@jest/fake-timers/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
||||
36
node_modules/@jest/fake-timers/build/FakeTimersLolex.d.ts
generated
vendored
Normal file
36
node_modules/@jest/fake-timers/build/FakeTimersLolex.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { StackTraceConfig } from 'jest-message-util';
|
||||
export default class FakeTimers {
|
||||
private _clock;
|
||||
private _config;
|
||||
private _fakingTime;
|
||||
private _global;
|
||||
private _lolex;
|
||||
private _maxLoops;
|
||||
constructor({ global, config, maxLoops, }: {
|
||||
global: NodeJS.Global;
|
||||
config: StackTraceConfig;
|
||||
maxLoops?: number;
|
||||
});
|
||||
clearAllTimers(): void;
|
||||
dispose(): void;
|
||||
runAllTimers(): void;
|
||||
runOnlyPendingTimers(): void;
|
||||
advanceTimersToNextTimer(steps?: number): void;
|
||||
advanceTimersByTime(msToRun: number): void;
|
||||
runAllTicks(): void;
|
||||
useRealTimers(): void;
|
||||
useFakeTimers(): void;
|
||||
reset(): void;
|
||||
setSystemTime(now?: number): void;
|
||||
getRealSystemTime(): number;
|
||||
getTimerCount(): number;
|
||||
private _checkFakeTimers;
|
||||
}
|
||||
//# sourceMappingURL=FakeTimersLolex.d.ts.map
|
||||
1
node_modules/@jest/fake-timers/build/FakeTimersLolex.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/fake-timers/build/FakeTimersLolex.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FakeTimersLolex.d.ts","sourceRoot":"","sources":["../src/FakeTimersLolex.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAOH,OAAO,EAAC,gBAAgB,EAAmB,MAAM,mBAAmB,CAAC;AAErE,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,SAAS,CAAS;gBAEd,EACV,MAAM,EACN,MAAM,EACN,QAAQ,GACT,EAAE;QACD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;QACtB,MAAM,EAAE,gBAAgB,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IASD,cAAc;IAMd,OAAO;IAIP,YAAY;IAMZ,oBAAoB;IAMpB,wBAAwB,CAAC,KAAK,SAAI;IAclC,mBAAmB,CAAC,OAAO,EAAE,MAAM;IAMnC,WAAW;IAOX,aAAa;IAOb,aAAa;IAiBb,KAAK;IAQL,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM;IAM1B,iBAAiB;IAIjB,aAAa;IAQb,OAAO,CAAC,gBAAgB;CAezB"}
|
||||
182
node_modules/@jest/fake-timers/build/FakeTimersLolex.js
generated
vendored
Normal file
182
node_modules/@jest/fake-timers/build/FakeTimersLolex.js
generated
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _lolex() {
|
||||
const data = require('lolex');
|
||||
|
||||
_lolex = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestMessageUtil() {
|
||||
const data = require('jest-message-util');
|
||||
|
||||
_jestMessageUtil = function() {
|
||||
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;
|
||||
}
|
||||
|
||||
class FakeTimers {
|
||||
constructor({global, config, maxLoops}) {
|
||||
_defineProperty(this, '_clock', void 0);
|
||||
|
||||
_defineProperty(this, '_config', void 0);
|
||||
|
||||
_defineProperty(this, '_fakingTime', void 0);
|
||||
|
||||
_defineProperty(this, '_global', void 0);
|
||||
|
||||
_defineProperty(this, '_lolex', void 0);
|
||||
|
||||
_defineProperty(this, '_maxLoops', void 0);
|
||||
|
||||
this._global = global;
|
||||
this._config = config;
|
||||
this._maxLoops = maxLoops || 100000;
|
||||
this._fakingTime = false;
|
||||
this._lolex = (0, _lolex().withGlobal)(global);
|
||||
}
|
||||
|
||||
clearAllTimers() {
|
||||
if (this._fakingTime) {
|
||||
this._clock.reset();
|
||||
}
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.useRealTimers();
|
||||
}
|
||||
|
||||
runAllTimers() {
|
||||
if (this._checkFakeTimers()) {
|
||||
this._clock.runAll();
|
||||
}
|
||||
}
|
||||
|
||||
runOnlyPendingTimers() {
|
||||
if (this._checkFakeTimers()) {
|
||||
this._clock.runToLast();
|
||||
}
|
||||
}
|
||||
|
||||
advanceTimersToNextTimer(steps = 1) {
|
||||
if (this._checkFakeTimers()) {
|
||||
for (let i = steps; i > 0; i--) {
|
||||
this._clock.next(); // Fire all timers at this point: https://github.com/sinonjs/lolex/issues/250
|
||||
|
||||
this._clock.tick(0);
|
||||
|
||||
if (this._clock.countTimers() === 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
advanceTimersByTime(msToRun) {
|
||||
if (this._checkFakeTimers()) {
|
||||
this._clock.tick(msToRun);
|
||||
}
|
||||
}
|
||||
|
||||
runAllTicks() {
|
||||
if (this._checkFakeTimers()) {
|
||||
// @ts-ignore
|
||||
this._clock.runMicrotasks();
|
||||
}
|
||||
}
|
||||
|
||||
useRealTimers() {
|
||||
if (this._fakingTime) {
|
||||
this._clock.uninstall();
|
||||
|
||||
this._fakingTime = false;
|
||||
}
|
||||
}
|
||||
|
||||
useFakeTimers() {
|
||||
if (!this._fakingTime) {
|
||||
const toFake = Object.keys(this._lolex.timers);
|
||||
this._clock = this._lolex.install({
|
||||
loopLimit: this._maxLoops,
|
||||
now: Date.now(),
|
||||
target: this._global,
|
||||
toFake
|
||||
});
|
||||
this._fakingTime = true;
|
||||
}
|
||||
}
|
||||
|
||||
reset() {
|
||||
if (this._checkFakeTimers()) {
|
||||
const {now} = this._clock;
|
||||
|
||||
this._clock.reset();
|
||||
|
||||
this._clock.setSystemTime(now);
|
||||
}
|
||||
}
|
||||
|
||||
setSystemTime(now) {
|
||||
if (this._checkFakeTimers()) {
|
||||
this._clock.setSystemTime(now);
|
||||
}
|
||||
}
|
||||
|
||||
getRealSystemTime() {
|
||||
return Date.now();
|
||||
}
|
||||
|
||||
getTimerCount() {
|
||||
if (this._checkFakeTimers()) {
|
||||
return this._clock.countTimers();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
_checkFakeTimers() {
|
||||
if (!this._fakingTime) {
|
||||
this._global.console.warn(
|
||||
'A function to advance timers was called but the timers API is not ' +
|
||||
'mocked with fake timers. Call `jest.useFakeTimers()` in this test or ' +
|
||||
'enable fake timers globally by setting `"timers": "fake"` in the ' +
|
||||
'configuration file\nStack Trace:\n' +
|
||||
(0, _jestMessageUtil().formatStackTrace)(
|
||||
new Error().stack,
|
||||
this._config,
|
||||
{
|
||||
noStackTrace: false
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return this._fakingTime;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = FakeTimers;
|
||||
9
node_modules/@jest/fake-timers/build/index.d.ts
generated
vendored
Normal file
9
node_modules/@jest/fake-timers/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* 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 JestFakeTimers } from './jestFakeTimers';
|
||||
export { default as LolexFakeTimers } from './FakeTimersLolex';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@jest/fake-timers/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/fake-timers/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,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mBAAmB,CAAC"}
|
||||
25
node_modules/@jest/fake-timers/build/index.js
generated
vendored
Normal file
25
node_modules/@jest/fake-timers/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'JestFakeTimers', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _jestFakeTimers.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'LolexFakeTimers', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _FakeTimersLolex.default;
|
||||
}
|
||||
});
|
||||
|
||||
var _jestFakeTimers = _interopRequireDefault(require('./jestFakeTimers'));
|
||||
|
||||
var _FakeTimersLolex = _interopRequireDefault(require('./FakeTimersLolex'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
63
node_modules/@jest/fake-timers/build/jestFakeTimers.d.ts
generated
vendored
Normal file
63
node_modules/@jest/fake-timers/build/jestFakeTimers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { ModuleMocker } from 'jest-mock';
|
||||
import { StackTraceConfig } from 'jest-message-util';
|
||||
declare type Callback = (...args: Array<unknown>) => void;
|
||||
declare type TimerConfig<Ref> = {
|
||||
idToRef: (id: number) => Ref;
|
||||
refToId: (ref: Ref) => number | void;
|
||||
};
|
||||
export default class FakeTimers<TimerRef> {
|
||||
private _cancelledTicks;
|
||||
private _config;
|
||||
private _disposed?;
|
||||
private _fakeTimerAPIs;
|
||||
private _global;
|
||||
private _immediates;
|
||||
private _maxLoops;
|
||||
private _moduleMocker;
|
||||
private _now;
|
||||
private _ticks;
|
||||
private _timerAPIs;
|
||||
private _timers;
|
||||
private _uuidCounter;
|
||||
private _timerConfig;
|
||||
constructor({ global, moduleMocker, timerConfig, config, maxLoops, }: {
|
||||
global: NodeJS.Global;
|
||||
moduleMocker: ModuleMocker;
|
||||
timerConfig: TimerConfig<TimerRef>;
|
||||
config: StackTraceConfig;
|
||||
maxLoops?: number;
|
||||
});
|
||||
clearAllTimers(): void;
|
||||
dispose(): void;
|
||||
reset(): void;
|
||||
runAllTicks(): void;
|
||||
runAllImmediates(): void;
|
||||
private _runImmediate;
|
||||
runAllTimers(): void;
|
||||
runOnlyPendingTimers(): void;
|
||||
advanceTimersToNextTimer(steps?: number): void;
|
||||
advanceTimersByTime(msToRun: number): void;
|
||||
runWithRealTimers(cb: Callback): void;
|
||||
useRealTimers(): void;
|
||||
useFakeTimers(): void;
|
||||
getTimerCount(): number;
|
||||
private _checkFakeTimers;
|
||||
private _createMocks;
|
||||
private _fakeClearTimer;
|
||||
private _fakeClearImmediate;
|
||||
private _fakeNextTick;
|
||||
private _fakeSetImmediate;
|
||||
private _fakeSetInterval;
|
||||
private _fakeSetTimeout;
|
||||
private _getNextTimerHandle;
|
||||
private _runTimerHandle;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=jestFakeTimers.d.ts.map
|
||||
1
node_modules/@jest/fake-timers/build/jestFakeTimers.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/fake-timers/build/jestFakeTimers.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"jestFakeTimers.d.ts","sourceRoot":"","sources":["../src/jestFakeTimers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EAAC,gBAAgB,EAAmB,MAAM,mBAAmB,CAAC;AAIrE,aAAK,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AA2BlD,aAAK,WAAW,CAAC,GAAG,IAAI;IACtB,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,GAAG,CAAC;IAC7B,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,GAAG,IAAI,CAAC;CACtC,CAAC;AAIF,MAAM,CAAC,OAAO,OAAO,UAAU,CAAC,QAAQ;IACtC,OAAO,CAAC,eAAe,CAA2B;IAClD,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,SAAS,CAAC,CAAU;IAC5B,OAAO,CAAC,cAAc,CAAY;IAClC,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,UAAU,CAAW;IAC7B,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,YAAY,CAAwB;gBAEhC,EACV,MAAM,EACN,YAAY,EACZ,WAAW,EACX,MAAM,EACN,QAAQ,GACT,EAAE;QACD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;QACtB,YAAY,EAAE,YAAY,CAAC;QAC3B,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,EAAE,gBAAgB,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IAuBD,cAAc;IAKd,OAAO;IAKP,KAAK;IAQL,WAAW;IA6BX,gBAAgB;IAsBhB,OAAO,CAAC,aAAa;IAQrB,YAAY;IAwCZ,oBAAoB;IAapB,wBAAwB,CAAC,KAAK,SAAI;IAiBlC,mBAAmB,CAAC,OAAO,EAAE,MAAM;IAuCnC,iBAAiB,CAAC,EAAE,EAAE,QAAQ;IAiC9B,aAAa;IAYb,aAAa;IAcb,aAAa;IAMb,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,YAAY;IAwBpB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,aAAa;IAsBrB,OAAO,CAAC,iBAAiB;IAyBzB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,eAAe;IAwBvB,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,eAAe;CAuBxB"}
|
||||
606
node_modules/@jest/fake-timers/build/jestFakeTimers.js
generated
vendored
Normal file
606
node_modules/@jest/fake-timers/build/jestFakeTimers.js
generated
vendored
Normal file
@@ -0,0 +1,606 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _jestMessageUtil() {
|
||||
const data = require('jest-message-util');
|
||||
|
||||
_jestMessageUtil = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _util() {
|
||||
const data = _interopRequireDefault(require('util'));
|
||||
|
||||
_util = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
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 MS_IN_A_YEAR = 31536000000;
|
||||
|
||||
class FakeTimers {
|
||||
constructor({global, moduleMocker, timerConfig, config, maxLoops}) {
|
||||
_defineProperty(this, '_cancelledTicks', void 0);
|
||||
|
||||
_defineProperty(this, '_config', void 0);
|
||||
|
||||
_defineProperty(this, '_disposed', void 0);
|
||||
|
||||
_defineProperty(this, '_fakeTimerAPIs', void 0);
|
||||
|
||||
_defineProperty(this, '_global', void 0);
|
||||
|
||||
_defineProperty(this, '_immediates', void 0);
|
||||
|
||||
_defineProperty(this, '_maxLoops', void 0);
|
||||
|
||||
_defineProperty(this, '_moduleMocker', void 0);
|
||||
|
||||
_defineProperty(this, '_now', void 0);
|
||||
|
||||
_defineProperty(this, '_ticks', void 0);
|
||||
|
||||
_defineProperty(this, '_timerAPIs', void 0);
|
||||
|
||||
_defineProperty(this, '_timers', void 0);
|
||||
|
||||
_defineProperty(this, '_uuidCounter', void 0);
|
||||
|
||||
_defineProperty(this, '_timerConfig', void 0);
|
||||
|
||||
this._global = global;
|
||||
this._timerConfig = timerConfig;
|
||||
this._config = config;
|
||||
this._maxLoops = maxLoops || 100000;
|
||||
this._uuidCounter = 1;
|
||||
this._moduleMocker = moduleMocker; // Store original timer APIs for future reference
|
||||
|
||||
this._timerAPIs = {
|
||||
clearImmediate: global.clearImmediate,
|
||||
clearInterval: global.clearInterval,
|
||||
clearTimeout: global.clearTimeout,
|
||||
nextTick: global.process && global.process.nextTick,
|
||||
setImmediate: global.setImmediate,
|
||||
setInterval: global.setInterval,
|
||||
setTimeout: global.setTimeout
|
||||
};
|
||||
this.reset();
|
||||
|
||||
this._createMocks();
|
||||
}
|
||||
|
||||
clearAllTimers() {
|
||||
this._immediates = [];
|
||||
|
||||
this._timers.clear();
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this._disposed = true;
|
||||
this.clearAllTimers();
|
||||
}
|
||||
|
||||
reset() {
|
||||
this._cancelledTicks = {};
|
||||
this._now = 0;
|
||||
this._ticks = [];
|
||||
this._immediates = [];
|
||||
this._timers = new Map();
|
||||
}
|
||||
|
||||
runAllTicks() {
|
||||
this._checkFakeTimers(); // Only run a generous number of ticks and then bail.
|
||||
// This is just to help avoid recursive loops
|
||||
|
||||
let i;
|
||||
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const tick = this._ticks.shift();
|
||||
|
||||
if (tick === undefined) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!this._cancelledTicks.hasOwnProperty(tick.uuid)) {
|
||||
// Callback may throw, so update the map prior calling.
|
||||
this._cancelledTicks[tick.uuid] = true;
|
||||
tick.callback();
|
||||
}
|
||||
}
|
||||
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(
|
||||
'Ran ' +
|
||||
this._maxLoops +
|
||||
' ticks, and there are still more! ' +
|
||||
"Assuming we've hit an infinite recursion and bailing out..."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
runAllImmediates() {
|
||||
this._checkFakeTimers(); // Only run a generous number of immediates and then bail.
|
||||
|
||||
let i;
|
||||
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const immediate = this._immediates.shift();
|
||||
|
||||
if (immediate === undefined) {
|
||||
break;
|
||||
}
|
||||
|
||||
this._runImmediate(immediate);
|
||||
}
|
||||
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(
|
||||
'Ran ' +
|
||||
this._maxLoops +
|
||||
' immediates, and there are still more! Assuming ' +
|
||||
"we've hit an infinite recursion and bailing out..."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_runImmediate(immediate) {
|
||||
try {
|
||||
immediate.callback();
|
||||
} finally {
|
||||
this._fakeClearImmediate(immediate.uuid);
|
||||
}
|
||||
}
|
||||
|
||||
runAllTimers() {
|
||||
this._checkFakeTimers();
|
||||
|
||||
this.runAllTicks();
|
||||
this.runAllImmediates(); // Only run a generous number of timers and then bail.
|
||||
// This is just to help avoid recursive loops
|
||||
|
||||
let i;
|
||||
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const nextTimerHandle = this._getNextTimerHandle(); // If there are no more timer handles, stop!
|
||||
|
||||
if (nextTimerHandle === null) {
|
||||
break;
|
||||
}
|
||||
|
||||
this._runTimerHandle(nextTimerHandle); // Some of the immediate calls could be enqueued
|
||||
// during the previous handling of the timers, we should
|
||||
// run them as well.
|
||||
|
||||
if (this._immediates.length) {
|
||||
this.runAllImmediates();
|
||||
}
|
||||
|
||||
if (this._ticks.length) {
|
||||
this.runAllTicks();
|
||||
}
|
||||
}
|
||||
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(
|
||||
'Ran ' +
|
||||
this._maxLoops +
|
||||
' timers, and there are still more! ' +
|
||||
"Assuming we've hit an infinite recursion and bailing out..."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
runOnlyPendingTimers() {
|
||||
// We need to hold the current shape of `this._timers` because existing
|
||||
// timers can add new ones to the map and hence would run more than necessary.
|
||||
// See https://github.com/facebook/jest/pull/4608 for details
|
||||
const timerEntries = Array.from(this._timers.entries());
|
||||
|
||||
this._checkFakeTimers();
|
||||
|
||||
this._immediates.forEach(this._runImmediate, this);
|
||||
|
||||
timerEntries
|
||||
.sort(([, left], [, right]) => left.expiry - right.expiry)
|
||||
.forEach(([timerHandle]) => this._runTimerHandle(timerHandle));
|
||||
}
|
||||
|
||||
advanceTimersToNextTimer(steps = 1) {
|
||||
if (steps < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
const nextExpiry = Array.from(this._timers.values()).reduce(
|
||||
(minExpiry, timer) => {
|
||||
if (minExpiry === null || timer.expiry < minExpiry) return timer.expiry;
|
||||
return minExpiry;
|
||||
},
|
||||
null
|
||||
);
|
||||
|
||||
if (nextExpiry !== null) {
|
||||
this.advanceTimersByTime(nextExpiry - this._now);
|
||||
this.advanceTimersToNextTimer(steps - 1);
|
||||
}
|
||||
}
|
||||
|
||||
advanceTimersByTime(msToRun) {
|
||||
this._checkFakeTimers(); // Only run a generous number of timers and then bail.
|
||||
// This is just to help avoid recursive loops
|
||||
|
||||
let i;
|
||||
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const timerHandle = this._getNextTimerHandle(); // If there are no more timer handles, stop!
|
||||
|
||||
if (timerHandle === null) {
|
||||
break;
|
||||
}
|
||||
|
||||
const timerValue = this._timers.get(timerHandle);
|
||||
|
||||
if (timerValue === undefined) {
|
||||
break;
|
||||
}
|
||||
|
||||
const nextTimerExpiry = timerValue.expiry;
|
||||
|
||||
if (this._now + msToRun < nextTimerExpiry) {
|
||||
// There are no timers between now and the target we're running to, so
|
||||
// adjust our time cursor and quit
|
||||
this._now += msToRun;
|
||||
break;
|
||||
} else {
|
||||
msToRun -= nextTimerExpiry - this._now;
|
||||
this._now = nextTimerExpiry;
|
||||
|
||||
this._runTimerHandle(timerHandle);
|
||||
}
|
||||
}
|
||||
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(
|
||||
'Ran ' +
|
||||
this._maxLoops +
|
||||
' timers, and there are still more! ' +
|
||||
"Assuming we've hit an infinite recursion and bailing out..."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
runWithRealTimers(cb) {
|
||||
const prevClearImmediate = this._global.clearImmediate;
|
||||
const prevClearInterval = this._global.clearInterval;
|
||||
const prevClearTimeout = this._global.clearTimeout;
|
||||
const prevNextTick = this._global.process.nextTick;
|
||||
const prevSetImmediate = this._global.setImmediate;
|
||||
const prevSetInterval = this._global.setInterval;
|
||||
const prevSetTimeout = this._global.setTimeout;
|
||||
this.useRealTimers();
|
||||
let cbErr = null;
|
||||
let errThrown = false;
|
||||
|
||||
try {
|
||||
cb();
|
||||
} catch (e) {
|
||||
errThrown = true;
|
||||
cbErr = e;
|
||||
}
|
||||
|
||||
this._global.clearImmediate = prevClearImmediate;
|
||||
this._global.clearInterval = prevClearInterval;
|
||||
this._global.clearTimeout = prevClearTimeout;
|
||||
this._global.process.nextTick = prevNextTick;
|
||||
this._global.setImmediate = prevSetImmediate;
|
||||
this._global.setInterval = prevSetInterval;
|
||||
this._global.setTimeout = prevSetTimeout;
|
||||
|
||||
if (errThrown) {
|
||||
throw cbErr;
|
||||
}
|
||||
}
|
||||
|
||||
useRealTimers() {
|
||||
const global = this._global;
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'clearImmediate',
|
||||
this._timerAPIs.clearImmediate
|
||||
);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'clearInterval',
|
||||
this._timerAPIs.clearInterval
|
||||
);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'clearTimeout',
|
||||
this._timerAPIs.clearTimeout
|
||||
);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'setImmediate',
|
||||
this._timerAPIs.setImmediate
|
||||
);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'setInterval',
|
||||
this._timerAPIs.setInterval
|
||||
);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'setTimeout',
|
||||
this._timerAPIs.setTimeout
|
||||
);
|
||||
global.process.nextTick = this._timerAPIs.nextTick;
|
||||
}
|
||||
|
||||
useFakeTimers() {
|
||||
this._createMocks();
|
||||
|
||||
const global = this._global;
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'clearImmediate',
|
||||
this._fakeTimerAPIs.clearImmediate
|
||||
);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'clearInterval',
|
||||
this._fakeTimerAPIs.clearInterval
|
||||
);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'clearTimeout',
|
||||
this._fakeTimerAPIs.clearTimeout
|
||||
);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'setImmediate',
|
||||
this._fakeTimerAPIs.setImmediate
|
||||
);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'setInterval',
|
||||
this._fakeTimerAPIs.setInterval
|
||||
);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
global,
|
||||
'setTimeout',
|
||||
this._fakeTimerAPIs.setTimeout
|
||||
);
|
||||
global.process.nextTick = this._fakeTimerAPIs.nextTick;
|
||||
}
|
||||
|
||||
getTimerCount() {
|
||||
this._checkFakeTimers();
|
||||
|
||||
return this._timers.size + this._immediates.length + this._ticks.length;
|
||||
}
|
||||
|
||||
_checkFakeTimers() {
|
||||
if (this._global.setTimeout !== this._fakeTimerAPIs.setTimeout) {
|
||||
this._global.console.warn(
|
||||
`A function to advance timers was called but the timers API is not ` +
|
||||
`mocked with fake timers. Call \`jest.useFakeTimers()\` in this ` +
|
||||
`test or enable fake timers globally by setting ` +
|
||||
`\`"timers": "fake"\` in ` +
|
||||
`the configuration file. This warning is likely a result of a ` +
|
||||
`default configuration change in Jest 15.\n\n` +
|
||||
`Release Blog Post: https://jestjs.io/blog/2016/09/01/jest-15.html\n` +
|
||||
`Stack Trace:\n` +
|
||||
(0, _jestMessageUtil().formatStackTrace)(
|
||||
new Error().stack,
|
||||
this._config,
|
||||
{
|
||||
noStackTrace: false
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_createMocks() {
|
||||
const fn = (
|
||||
impl // @ts-ignore TODO: figure out better typings here
|
||||
) => this._moduleMocker.fn().mockImplementation(impl);
|
||||
|
||||
const promisifiableFakeSetTimeout = fn(this._fakeSetTimeout.bind(this));
|
||||
|
||||
promisifiableFakeSetTimeout[_util().default.promisify.custom] = (
|
||||
delay,
|
||||
arg
|
||||
) =>
|
||||
new Promise(resolve => promisifiableFakeSetTimeout(resolve, delay, arg)); // TODO: add better typings; these are mocks, but typed as regular timers
|
||||
|
||||
this._fakeTimerAPIs = {
|
||||
clearImmediate: fn(this._fakeClearImmediate.bind(this)),
|
||||
clearInterval: fn(this._fakeClearTimer.bind(this)),
|
||||
clearTimeout: fn(this._fakeClearTimer.bind(this)),
|
||||
nextTick: fn(this._fakeNextTick.bind(this)),
|
||||
setImmediate: fn(this._fakeSetImmediate.bind(this)),
|
||||
setInterval: fn(this._fakeSetInterval.bind(this)),
|
||||
setTimeout: promisifiableFakeSetTimeout
|
||||
};
|
||||
}
|
||||
|
||||
_fakeClearTimer(timerRef) {
|
||||
const uuid = this._timerConfig.refToId(timerRef);
|
||||
|
||||
if (uuid) {
|
||||
this._timers.delete(String(uuid));
|
||||
}
|
||||
}
|
||||
|
||||
_fakeClearImmediate(uuid) {
|
||||
this._immediates = this._immediates.filter(
|
||||
immediate => immediate.uuid !== uuid
|
||||
);
|
||||
}
|
||||
|
||||
_fakeNextTick(callback, ...args) {
|
||||
if (this._disposed) {
|
||||
return;
|
||||
}
|
||||
|
||||
const uuid = String(this._uuidCounter++);
|
||||
|
||||
this._ticks.push({
|
||||
callback: () => callback.apply(null, args),
|
||||
uuid
|
||||
});
|
||||
|
||||
const cancelledTicks = this._cancelledTicks;
|
||||
|
||||
this._timerAPIs.nextTick(() => {
|
||||
if (!cancelledTicks.hasOwnProperty(uuid)) {
|
||||
// Callback may throw, so update the map prior calling.
|
||||
cancelledTicks[uuid] = true;
|
||||
callback.apply(null, args);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_fakeSetImmediate(callback, ...args) {
|
||||
if (this._disposed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const uuid = String(this._uuidCounter++);
|
||||
|
||||
this._immediates.push({
|
||||
callback: () => callback.apply(null, args),
|
||||
uuid
|
||||
});
|
||||
|
||||
this._timerAPIs.setImmediate(() => {
|
||||
if (this._immediates.find(x => x.uuid === uuid)) {
|
||||
try {
|
||||
callback.apply(null, args);
|
||||
} finally {
|
||||
this._fakeClearImmediate(uuid);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return uuid;
|
||||
}
|
||||
|
||||
_fakeSetInterval(callback, intervalDelay, ...args) {
|
||||
if (this._disposed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (intervalDelay == null) {
|
||||
intervalDelay = 0;
|
||||
}
|
||||
|
||||
const uuid = this._uuidCounter++;
|
||||
|
||||
this._timers.set(String(uuid), {
|
||||
callback: () => callback.apply(null, args),
|
||||
expiry: this._now + intervalDelay,
|
||||
interval: intervalDelay,
|
||||
type: 'interval'
|
||||
});
|
||||
|
||||
return this._timerConfig.idToRef(uuid);
|
||||
}
|
||||
|
||||
_fakeSetTimeout(callback, delay, ...args) {
|
||||
if (this._disposed) {
|
||||
return null;
|
||||
} // eslint-disable-next-line no-bitwise
|
||||
|
||||
delay = Number(delay) | 0;
|
||||
const uuid = this._uuidCounter++;
|
||||
|
||||
this._timers.set(String(uuid), {
|
||||
callback: () => callback.apply(null, args),
|
||||
expiry: this._now + delay,
|
||||
interval: undefined,
|
||||
type: 'timeout'
|
||||
});
|
||||
|
||||
return this._timerConfig.idToRef(uuid);
|
||||
}
|
||||
|
||||
_getNextTimerHandle() {
|
||||
let nextTimerHandle = null;
|
||||
let soonestTime = MS_IN_A_YEAR;
|
||||
|
||||
this._timers.forEach((timer, uuid) => {
|
||||
if (timer.expiry < soonestTime) {
|
||||
soonestTime = timer.expiry;
|
||||
nextTimerHandle = uuid;
|
||||
}
|
||||
});
|
||||
|
||||
return nextTimerHandle;
|
||||
}
|
||||
|
||||
_runTimerHandle(timerHandle) {
|
||||
const timer = this._timers.get(timerHandle);
|
||||
|
||||
if (!timer) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (timer.type) {
|
||||
case 'timeout':
|
||||
const callback = timer.callback;
|
||||
|
||||
this._timers.delete(timerHandle);
|
||||
|
||||
callback();
|
||||
break;
|
||||
|
||||
case 'interval':
|
||||
timer.expiry = this._now + (timer.interval || 0);
|
||||
timer.callback();
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error('Unexpected timer type: ' + timer.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = FakeTimers;
|
||||
61
node_modules/@jest/fake-timers/package.json
generated
vendored
Normal file
61
node_modules/@jest/fake-timers/package.json
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"_from": "@jest/fake-timers@^25.1.0",
|
||||
"_id": "@jest/fake-timers@25.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-Eu3dysBzSAO1lD7cylZd/CVKdZZ1/43SF35iYBNV1Lvvn2Undp3Grwsv8PrzvbLhqwRzDd4zxrY4gsiHc+wygQ==",
|
||||
"_location": "/@jest/fake-timers",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@jest/fake-timers@^25.1.0",
|
||||
"name": "@jest/fake-timers",
|
||||
"escapedName": "@jest%2ffake-timers",
|
||||
"scope": "@jest",
|
||||
"rawSpec": "^25.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^25.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@jest/environment",
|
||||
"/jest-environment-jsdom",
|
||||
"/jest-environment-node"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-25.1.0.tgz",
|
||||
"_shasum": "a1e0eff51ffdbb13ee81f35b52e0c1c11a350ce8",
|
||||
"_spec": "@jest/fake-timers@^25.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx/node_modules/@jest/environment",
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@jest/types": "^25.1.0",
|
||||
"jest-message-util": "^25.1.0",
|
||||
"jest-mock": "^25.1.0",
|
||||
"jest-util": "^25.1.0",
|
||||
"lolex": "^5.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"devDependencies": {
|
||||
"@types/lolex": "^5.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.3"
|
||||
},
|
||||
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638",
|
||||
"homepage": "https://github.com/facebook/jest#readme",
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "@jest/fake-timers",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-fake-timers"
|
||||
},
|
||||
"types": "build/index.d.ts",
|
||||
"version": "25.1.0"
|
||||
}
|
||||
21
node_modules/@jest/source-map/LICENSE
generated
vendored
Normal file
21
node_modules/@jest/source-map/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
||||
10
node_modules/@jest/source-map/build/getCallsite.d.ts
generated
vendored
Normal file
10
node_modules/@jest/source-map/build/getCallsite.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* 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 callsites = require('callsites');
|
||||
declare const _default: (level: number, sourceMaps?: Record<string, string> | null | undefined) => callsites.CallSite;
|
||||
export default _default;
|
||||
//# sourceMappingURL=getCallsite.d.ts.map
|
||||
1
node_modules/@jest/source-map/build/getCallsite.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/source-map/build/getCallsite.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getCallsite.d.ts","sourceRoot":"","sources":["../src/getCallsite.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,SAAS,GAAG,QAAQ,WAAW,CAAC,CAAC;;AAwCxC,wBAgBE"}
|
||||
107
node_modules/@jest/source-map/build/getCallsite.js
generated
vendored
Normal file
107
node_modules/@jest/source-map/build/getCallsite.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _gracefulFs() {
|
||||
const data = require('graceful-fs');
|
||||
|
||||
_gracefulFs = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _callsites() {
|
||||
const data = _interopRequireDefault(require('callsites'));
|
||||
|
||||
_callsites = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _sourceMap() {
|
||||
const data = require('source-map');
|
||||
|
||||
_sourceMap = function() {
|
||||
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.
|
||||
*/
|
||||
// Copied from https://github.com/rexxars/sourcemap-decorate-callsites/blob/5b9735a156964973a75dc62fd2c7f0c1975458e8/lib/index.js#L113-L158
|
||||
const addSourceMapConsumer = (callsite, consumer) => {
|
||||
const getLineNumber = callsite.getLineNumber;
|
||||
const getColumnNumber = callsite.getColumnNumber;
|
||||
let position = null;
|
||||
|
||||
function getPosition() {
|
||||
if (!position) {
|
||||
position = consumer.originalPositionFor({
|
||||
column: getColumnNumber.call(callsite) || -1,
|
||||
line: getLineNumber.call(callsite) || -1
|
||||
});
|
||||
}
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
Object.defineProperties(callsite, {
|
||||
getColumnNumber: {
|
||||
value() {
|
||||
return getPosition().column || getColumnNumber.call(callsite);
|
||||
},
|
||||
|
||||
writable: false
|
||||
},
|
||||
getLineNumber: {
|
||||
value() {
|
||||
return getPosition().line || getLineNumber.call(callsite);
|
||||
},
|
||||
|
||||
writable: false
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _default = (level, sourceMaps) => {
|
||||
const levelAfterThisCall = level + 1;
|
||||
const stack = (0, _callsites().default)()[levelAfterThisCall];
|
||||
const sourceMapFileName = sourceMaps && sourceMaps[stack.getFileName() || ''];
|
||||
|
||||
if (sourceMapFileName) {
|
||||
try {
|
||||
const sourceMap = (0, _gracefulFs().readFileSync)(
|
||||
sourceMapFileName,
|
||||
'utf8'
|
||||
); // @ts-ignore: Not allowed to pass string
|
||||
|
||||
addSourceMapConsumer(
|
||||
stack,
|
||||
new (_sourceMap().SourceMapConsumer)(sourceMap)
|
||||
);
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
};
|
||||
|
||||
exports.default = _default;
|
||||
9
node_modules/@jest/source-map/build/index.d.ts
generated
vendored
Normal file
9
node_modules/@jest/source-map/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* 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 getCallsite } from './getCallsite';
|
||||
export { SourceMapRegistry } from './types';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@jest/source-map/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/source-map/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,WAAW,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC"}
|
||||
25
node_modules/@jest/source-map/build/index.js
generated
vendored
Normal file
25
node_modules/@jest/source-map/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'getCallsite', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _getCallsite.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'SourceMapRegistry', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.SourceMapRegistry;
|
||||
}
|
||||
});
|
||||
|
||||
var _getCallsite = _interopRequireDefault(require('./getCallsite'));
|
||||
|
||||
var _types = require('./types');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
8
node_modules/@jest/source-map/build/types.d.ts
generated
vendored
Normal file
8
node_modules/@jest/source-map/build/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* 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 declare type SourceMapRegistry = Record<string, string>;
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
1
node_modules/@jest/source-map/build/types.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/source-map/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,oBAAY,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
||||
1
node_modules/@jest/source-map/build/types.js
generated
vendored
Normal file
1
node_modules/@jest/source-map/build/types.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
'use strict';
|
||||
15
node_modules/@jest/source-map/node_modules/graceful-fs/LICENSE
generated
vendored
Normal file
15
node_modules/@jest/source-map/node_modules/graceful-fs/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
133
node_modules/@jest/source-map/node_modules/graceful-fs/README.md
generated
vendored
Normal file
133
node_modules/@jest/source-map/node_modules/graceful-fs/README.md
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
# graceful-fs
|
||||
|
||||
graceful-fs functions as a drop-in replacement for the fs module,
|
||||
making various improvements.
|
||||
|
||||
The improvements are meant to normalize behavior across different
|
||||
platforms and environments, and to make filesystem access more
|
||||
resilient to errors.
|
||||
|
||||
## Improvements over [fs module](https://nodejs.org/api/fs.html)
|
||||
|
||||
* Queues up `open` and `readdir` calls, and retries them once
|
||||
something closes if there is an EMFILE error from too many file
|
||||
descriptors.
|
||||
* fixes `lchmod` for Node versions prior to 0.6.2.
|
||||
* implements `fs.lutimes` if possible. Otherwise it becomes a noop.
|
||||
* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or
|
||||
`lchown` if the user isn't root.
|
||||
* makes `lchmod` and `lchown` become noops, if not available.
|
||||
* retries reading a file if `read` results in EAGAIN error.
|
||||
|
||||
On Windows, it retries renaming a file for up to one second if `EACCESS`
|
||||
or `EPERM` error occurs, likely because antivirus software has locked
|
||||
the directory.
|
||||
|
||||
## USAGE
|
||||
|
||||
```javascript
|
||||
// use just like fs
|
||||
var fs = require('graceful-fs')
|
||||
|
||||
// now go and do stuff with it...
|
||||
fs.readFileSync('some-file-or-whatever')
|
||||
```
|
||||
|
||||
## Global Patching
|
||||
|
||||
If you want to patch the global fs module (or any other fs-like
|
||||
module) you can do this:
|
||||
|
||||
```javascript
|
||||
// Make sure to read the caveat below.
|
||||
var realFs = require('fs')
|
||||
var gracefulFs = require('graceful-fs')
|
||||
gracefulFs.gracefulify(realFs)
|
||||
```
|
||||
|
||||
This should only ever be done at the top-level application layer, in
|
||||
order to delay on EMFILE errors from any fs-using dependencies. You
|
||||
should **not** do this in a library, because it can cause unexpected
|
||||
delays in other parts of the program.
|
||||
|
||||
## Changes
|
||||
|
||||
This module is fairly stable at this point, and used by a lot of
|
||||
things. That being said, because it implements a subtle behavior
|
||||
change in a core part of the node API, even modest changes can be
|
||||
extremely breaking, and the versioning is thus biased towards
|
||||
bumping the major when in doubt.
|
||||
|
||||
The main change between major versions has been switching between
|
||||
providing a fully-patched `fs` module vs monkey-patching the node core
|
||||
builtin, and the approach by which a non-monkey-patched `fs` was
|
||||
created.
|
||||
|
||||
The goal is to trade `EMFILE` errors for slower fs operations. So, if
|
||||
you try to open a zillion files, rather than crashing, `open`
|
||||
operations will be queued up and wait for something else to `close`.
|
||||
|
||||
There are advantages to each approach. Monkey-patching the fs means
|
||||
that no `EMFILE` errors can possibly occur anywhere in your
|
||||
application, because everything is using the same core `fs` module,
|
||||
which is patched. However, it can also obviously cause undesirable
|
||||
side-effects, especially if the module is loaded multiple times.
|
||||
|
||||
Implementing a separate-but-identical patched `fs` module is more
|
||||
surgical (and doesn't run the risk of patching multiple times), but
|
||||
also imposes the challenge of keeping in sync with the core module.
|
||||
|
||||
The current approach loads the `fs` module, and then creates a
|
||||
lookalike object that has all the same methods, except a few that are
|
||||
patched. It is safe to use in all versions of Node from 0.8 through
|
||||
7.0.
|
||||
|
||||
### v4
|
||||
|
||||
* Do not monkey-patch the fs module. This module may now be used as a
|
||||
drop-in dep, and users can opt into monkey-patching the fs builtin
|
||||
if their app requires it.
|
||||
|
||||
### v3
|
||||
|
||||
* Monkey-patch fs, because the eval approach no longer works on recent
|
||||
node.
|
||||
* fixed possible type-error throw if rename fails on windows
|
||||
* verify that we *never* get EMFILE errors
|
||||
* Ignore ENOSYS from chmod/chown
|
||||
* clarify that graceful-fs must be used as a drop-in
|
||||
|
||||
### v2.1.0
|
||||
|
||||
* Use eval rather than monkey-patching fs.
|
||||
* readdir: Always sort the results
|
||||
* win32: requeue a file if error has an OK status
|
||||
|
||||
### v2.0
|
||||
|
||||
* A return to monkey patching
|
||||
* wrap process.cwd
|
||||
|
||||
### v1.1
|
||||
|
||||
* wrap readFile
|
||||
* Wrap fs.writeFile.
|
||||
* readdir protection
|
||||
* Don't clobber the fs builtin
|
||||
* Handle fs.read EAGAIN errors by trying again
|
||||
* Expose the curOpen counter
|
||||
* No-op lchown/lchmod if not implemented
|
||||
* fs.rename patch only for win32
|
||||
* Patch fs.rename to handle AV software on Windows
|
||||
* Close #4 Chown should not fail on einval or eperm if non-root
|
||||
* Fix isaacs/fstream#1 Only wrap fs one time
|
||||
* Fix #3 Start at 1024 max files, then back off on EMFILE
|
||||
* lutimes that doens't blow up on Linux
|
||||
* A full on-rewrite using a queue instead of just swallowing the EMFILE error
|
||||
* Wrap Read/Write streams as well
|
||||
|
||||
### 1.0
|
||||
|
||||
* Update engines for node 0.6
|
||||
* Be lstat-graceful on Windows
|
||||
* first
|
||||
19
node_modules/@jest/source-map/node_modules/graceful-fs/clone.js
generated
vendored
Normal file
19
node_modules/@jest/source-map/node_modules/graceful-fs/clone.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = clone
|
||||
|
||||
function clone (obj) {
|
||||
if (obj === null || typeof obj !== 'object')
|
||||
return obj
|
||||
|
||||
if (obj instanceof Object)
|
||||
var copy = { __proto__: obj.__proto__ }
|
||||
else
|
||||
var copy = Object.create(null)
|
||||
|
||||
Object.getOwnPropertyNames(obj).forEach(function (key) {
|
||||
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
|
||||
})
|
||||
|
||||
return copy
|
||||
}
|
||||
346
node_modules/@jest/source-map/node_modules/graceful-fs/graceful-fs.js
generated
vendored
Normal file
346
node_modules/@jest/source-map/node_modules/graceful-fs/graceful-fs.js
generated
vendored
Normal file
@@ -0,0 +1,346 @@
|
||||
var fs = require('fs')
|
||||
var polyfills = require('./polyfills.js')
|
||||
var legacy = require('./legacy-streams.js')
|
||||
var clone = require('./clone.js')
|
||||
|
||||
var util = require('util')
|
||||
|
||||
/* istanbul ignore next - node 0.x polyfill */
|
||||
var gracefulQueue
|
||||
var previousSymbol
|
||||
|
||||
/* istanbul ignore else - node 0.x polyfill */
|
||||
if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
|
||||
gracefulQueue = Symbol.for('graceful-fs.queue')
|
||||
// This is used in testing by future versions
|
||||
previousSymbol = Symbol.for('graceful-fs.previous')
|
||||
} else {
|
||||
gracefulQueue = '___graceful-fs.queue'
|
||||
previousSymbol = '___graceful-fs.previous'
|
||||
}
|
||||
|
||||
function noop () {}
|
||||
|
||||
var debug = noop
|
||||
if (util.debuglog)
|
||||
debug = util.debuglog('gfs4')
|
||||
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
|
||||
debug = function() {
|
||||
var m = util.format.apply(util, arguments)
|
||||
m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
|
||||
console.error(m)
|
||||
}
|
||||
|
||||
// Once time initialization
|
||||
if (!global[gracefulQueue]) {
|
||||
// This queue can be shared by multiple loaded instances
|
||||
var queue = []
|
||||
Object.defineProperty(global, gracefulQueue, {
|
||||
get: function() {
|
||||
return queue
|
||||
}
|
||||
})
|
||||
|
||||
// Patch fs.close/closeSync to shared queue version, because we need
|
||||
// to retry() whenever a close happens *anywhere* in the program.
|
||||
// This is essential when multiple graceful-fs instances are
|
||||
// in play at the same time.
|
||||
fs.close = (function (fs$close) {
|
||||
function close (fd, cb) {
|
||||
return fs$close.call(fs, fd, function (err) {
|
||||
// This function uses the graceful-fs shared queue
|
||||
if (!err) {
|
||||
retry()
|
||||
}
|
||||
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
})
|
||||
}
|
||||
|
||||
Object.defineProperty(close, previousSymbol, {
|
||||
value: fs$close
|
||||
})
|
||||
return close
|
||||
})(fs.close)
|
||||
|
||||
fs.closeSync = (function (fs$closeSync) {
|
||||
function closeSync (fd) {
|
||||
// This function uses the graceful-fs shared queue
|
||||
fs$closeSync.apply(fs, arguments)
|
||||
retry()
|
||||
}
|
||||
|
||||
Object.defineProperty(closeSync, previousSymbol, {
|
||||
value: fs$closeSync
|
||||
})
|
||||
return closeSync
|
||||
})(fs.closeSync)
|
||||
|
||||
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
|
||||
process.on('exit', function() {
|
||||
debug(global[gracefulQueue])
|
||||
require('assert').equal(global[gracefulQueue].length, 0)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = patch(clone(fs))
|
||||
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
|
||||
module.exports = patch(fs)
|
||||
fs.__patched = true;
|
||||
}
|
||||
|
||||
function patch (fs) {
|
||||
// Everything that references the open() function needs to be in here
|
||||
polyfills(fs)
|
||||
fs.gracefulify = patch
|
||||
|
||||
fs.createReadStream = createReadStream
|
||||
fs.createWriteStream = createWriteStream
|
||||
var fs$readFile = fs.readFile
|
||||
fs.readFile = readFile
|
||||
function readFile (path, options, cb) {
|
||||
if (typeof options === 'function')
|
||||
cb = options, options = null
|
||||
|
||||
return go$readFile(path, options, cb)
|
||||
|
||||
function go$readFile (path, options, cb) {
|
||||
return fs$readFile(path, options, function (err) {
|
||||
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
|
||||
enqueue([go$readFile, [path, options, cb]])
|
||||
else {
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
retry()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
var fs$writeFile = fs.writeFile
|
||||
fs.writeFile = writeFile
|
||||
function writeFile (path, data, options, cb) {
|
||||
if (typeof options === 'function')
|
||||
cb = options, options = null
|
||||
|
||||
return go$writeFile(path, data, options, cb)
|
||||
|
||||
function go$writeFile (path, data, options, cb) {
|
||||
return fs$writeFile(path, data, options, function (err) {
|
||||
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
|
||||
enqueue([go$writeFile, [path, data, options, cb]])
|
||||
else {
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
retry()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
var fs$appendFile = fs.appendFile
|
||||
if (fs$appendFile)
|
||||
fs.appendFile = appendFile
|
||||
function appendFile (path, data, options, cb) {
|
||||
if (typeof options === 'function')
|
||||
cb = options, options = null
|
||||
|
||||
return go$appendFile(path, data, options, cb)
|
||||
|
||||
function go$appendFile (path, data, options, cb) {
|
||||
return fs$appendFile(path, data, options, function (err) {
|
||||
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
|
||||
enqueue([go$appendFile, [path, data, options, cb]])
|
||||
else {
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
retry()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
var fs$readdir = fs.readdir
|
||||
fs.readdir = readdir
|
||||
function readdir (path, options, cb) {
|
||||
var args = [path]
|
||||
if (typeof options !== 'function') {
|
||||
args.push(options)
|
||||
} else {
|
||||
cb = options
|
||||
}
|
||||
args.push(go$readdir$cb)
|
||||
|
||||
return go$readdir(args)
|
||||
|
||||
function go$readdir$cb (err, files) {
|
||||
if (files && files.sort)
|
||||
files.sort()
|
||||
|
||||
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
|
||||
enqueue([go$readdir, [args]])
|
||||
|
||||
else {
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
retry()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function go$readdir (args) {
|
||||
return fs$readdir.apply(fs, args)
|
||||
}
|
||||
|
||||
if (process.version.substr(0, 4) === 'v0.8') {
|
||||
var legStreams = legacy(fs)
|
||||
ReadStream = legStreams.ReadStream
|
||||
WriteStream = legStreams.WriteStream
|
||||
}
|
||||
|
||||
var fs$ReadStream = fs.ReadStream
|
||||
if (fs$ReadStream) {
|
||||
ReadStream.prototype = Object.create(fs$ReadStream.prototype)
|
||||
ReadStream.prototype.open = ReadStream$open
|
||||
}
|
||||
|
||||
var fs$WriteStream = fs.WriteStream
|
||||
if (fs$WriteStream) {
|
||||
WriteStream.prototype = Object.create(fs$WriteStream.prototype)
|
||||
WriteStream.prototype.open = WriteStream$open
|
||||
}
|
||||
|
||||
Object.defineProperty(fs, 'ReadStream', {
|
||||
get: function () {
|
||||
return ReadStream
|
||||
},
|
||||
set: function (val) {
|
||||
ReadStream = val
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
})
|
||||
Object.defineProperty(fs, 'WriteStream', {
|
||||
get: function () {
|
||||
return WriteStream
|
||||
},
|
||||
set: function (val) {
|
||||
WriteStream = val
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
})
|
||||
|
||||
// legacy names
|
||||
var FileReadStream = ReadStream
|
||||
Object.defineProperty(fs, 'FileReadStream', {
|
||||
get: function () {
|
||||
return FileReadStream
|
||||
},
|
||||
set: function (val) {
|
||||
FileReadStream = val
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
})
|
||||
var FileWriteStream = WriteStream
|
||||
Object.defineProperty(fs, 'FileWriteStream', {
|
||||
get: function () {
|
||||
return FileWriteStream
|
||||
},
|
||||
set: function (val) {
|
||||
FileWriteStream = val
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
})
|
||||
|
||||
function ReadStream (path, options) {
|
||||
if (this instanceof ReadStream)
|
||||
return fs$ReadStream.apply(this, arguments), this
|
||||
else
|
||||
return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
|
||||
}
|
||||
|
||||
function ReadStream$open () {
|
||||
var that = this
|
||||
open(that.path, that.flags, that.mode, function (err, fd) {
|
||||
if (err) {
|
||||
if (that.autoClose)
|
||||
that.destroy()
|
||||
|
||||
that.emit('error', err)
|
||||
} else {
|
||||
that.fd = fd
|
||||
that.emit('open', fd)
|
||||
that.read()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function WriteStream (path, options) {
|
||||
if (this instanceof WriteStream)
|
||||
return fs$WriteStream.apply(this, arguments), this
|
||||
else
|
||||
return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
|
||||
}
|
||||
|
||||
function WriteStream$open () {
|
||||
var that = this
|
||||
open(that.path, that.flags, that.mode, function (err, fd) {
|
||||
if (err) {
|
||||
that.destroy()
|
||||
that.emit('error', err)
|
||||
} else {
|
||||
that.fd = fd
|
||||
that.emit('open', fd)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function createReadStream (path, options) {
|
||||
return new fs.ReadStream(path, options)
|
||||
}
|
||||
|
||||
function createWriteStream (path, options) {
|
||||
return new fs.WriteStream(path, options)
|
||||
}
|
||||
|
||||
var fs$open = fs.open
|
||||
fs.open = open
|
||||
function open (path, flags, mode, cb) {
|
||||
if (typeof mode === 'function')
|
||||
cb = mode, mode = null
|
||||
|
||||
return go$open(path, flags, mode, cb)
|
||||
|
||||
function go$open (path, flags, mode, cb) {
|
||||
return fs$open(path, flags, mode, function (err, fd) {
|
||||
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
|
||||
enqueue([go$open, [path, flags, mode, cb]])
|
||||
else {
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
retry()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return fs
|
||||
}
|
||||
|
||||
function enqueue (elem) {
|
||||
debug('ENQUEUE', elem[0].name, elem[1])
|
||||
global[gracefulQueue].push(elem)
|
||||
}
|
||||
|
||||
function retry () {
|
||||
var elem = global[gracefulQueue].shift()
|
||||
if (elem) {
|
||||
debug('RETRY', elem[0].name, elem[1])
|
||||
elem[0].apply(null, elem[1])
|
||||
}
|
||||
}
|
||||
118
node_modules/@jest/source-map/node_modules/graceful-fs/legacy-streams.js
generated
vendored
Normal file
118
node_modules/@jest/source-map/node_modules/graceful-fs/legacy-streams.js
generated
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
var Stream = require('stream').Stream
|
||||
|
||||
module.exports = legacy
|
||||
|
||||
function legacy (fs) {
|
||||
return {
|
||||
ReadStream: ReadStream,
|
||||
WriteStream: WriteStream
|
||||
}
|
||||
|
||||
function ReadStream (path, options) {
|
||||
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
|
||||
|
||||
Stream.call(this);
|
||||
|
||||
var self = this;
|
||||
|
||||
this.path = path;
|
||||
this.fd = null;
|
||||
this.readable = true;
|
||||
this.paused = false;
|
||||
|
||||
this.flags = 'r';
|
||||
this.mode = 438; /*=0666*/
|
||||
this.bufferSize = 64 * 1024;
|
||||
|
||||
options = options || {};
|
||||
|
||||
// Mixin options into this
|
||||
var keys = Object.keys(options);
|
||||
for (var index = 0, length = keys.length; index < length; index++) {
|
||||
var key = keys[index];
|
||||
this[key] = options[key];
|
||||
}
|
||||
|
||||
if (this.encoding) this.setEncoding(this.encoding);
|
||||
|
||||
if (this.start !== undefined) {
|
||||
if ('number' !== typeof this.start) {
|
||||
throw TypeError('start must be a Number');
|
||||
}
|
||||
if (this.end === undefined) {
|
||||
this.end = Infinity;
|
||||
} else if ('number' !== typeof this.end) {
|
||||
throw TypeError('end must be a Number');
|
||||
}
|
||||
|
||||
if (this.start > this.end) {
|
||||
throw new Error('start must be <= end');
|
||||
}
|
||||
|
||||
this.pos = this.start;
|
||||
}
|
||||
|
||||
if (this.fd !== null) {
|
||||
process.nextTick(function() {
|
||||
self._read();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
fs.open(this.path, this.flags, this.mode, function (err, fd) {
|
||||
if (err) {
|
||||
self.emit('error', err);
|
||||
self.readable = false;
|
||||
return;
|
||||
}
|
||||
|
||||
self.fd = fd;
|
||||
self.emit('open', fd);
|
||||
self._read();
|
||||
})
|
||||
}
|
||||
|
||||
function WriteStream (path, options) {
|
||||
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
|
||||
|
||||
Stream.call(this);
|
||||
|
||||
this.path = path;
|
||||
this.fd = null;
|
||||
this.writable = true;
|
||||
|
||||
this.flags = 'w';
|
||||
this.encoding = 'binary';
|
||||
this.mode = 438; /*=0666*/
|
||||
this.bytesWritten = 0;
|
||||
|
||||
options = options || {};
|
||||
|
||||
// Mixin options into this
|
||||
var keys = Object.keys(options);
|
||||
for (var index = 0, length = keys.length; index < length; index++) {
|
||||
var key = keys[index];
|
||||
this[key] = options[key];
|
||||
}
|
||||
|
||||
if (this.start !== undefined) {
|
||||
if ('number' !== typeof this.start) {
|
||||
throw TypeError('start must be a Number');
|
||||
}
|
||||
if (this.start < 0) {
|
||||
throw new Error('start must be >= zero');
|
||||
}
|
||||
|
||||
this.pos = this.start;
|
||||
}
|
||||
|
||||
this.busy = false;
|
||||
this._queue = [];
|
||||
|
||||
if (this.fd === null) {
|
||||
this._open = fs.open;
|
||||
this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
|
||||
this.flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
79
node_modules/@jest/source-map/node_modules/graceful-fs/package.json
generated
vendored
Normal file
79
node_modules/@jest/source-map/node_modules/graceful-fs/package.json
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"_from": "graceful-fs@^4.2.3",
|
||||
"_id": "graceful-fs@4.2.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==",
|
||||
"_location": "/@jest/source-map/graceful-fs",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "graceful-fs@^4.2.3",
|
||||
"name": "graceful-fs",
|
||||
"escapedName": "graceful-fs",
|
||||
"rawSpec": "^4.2.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^4.2.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@jest/source-map"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
|
||||
"_shasum": "4a12ff1b60376ef09862c2093edd908328be8423",
|
||||
"_spec": "graceful-fs@^4.2.3",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx/node_modules/@jest/source-map",
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/node-graceful-fs/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "A drop-in replacement for fs, making various improvements.",
|
||||
"devDependencies": {
|
||||
"import-fresh": "^2.0.0",
|
||||
"mkdirp": "^0.5.0",
|
||||
"rimraf": "^2.2.8",
|
||||
"tap": "^12.7.0"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"files": [
|
||||
"fs.js",
|
||||
"graceful-fs.js",
|
||||
"legacy-streams.js",
|
||||
"polyfills.js",
|
||||
"clone.js"
|
||||
],
|
||||
"homepage": "https://github.com/isaacs/node-graceful-fs#readme",
|
||||
"keywords": [
|
||||
"fs",
|
||||
"module",
|
||||
"reading",
|
||||
"retry",
|
||||
"retries",
|
||||
"queue",
|
||||
"error",
|
||||
"errors",
|
||||
"handling",
|
||||
"EMFILE",
|
||||
"EAGAIN",
|
||||
"EINVAL",
|
||||
"EPERM",
|
||||
"EACCESS"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "graceful-fs.js",
|
||||
"name": "graceful-fs",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/isaacs/node-graceful-fs.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "git push origin --follow-tags",
|
||||
"postversion": "npm publish",
|
||||
"preversion": "npm test",
|
||||
"test": "node test.js | tap -"
|
||||
},
|
||||
"version": "4.2.3"
|
||||
}
|
||||
342
node_modules/@jest/source-map/node_modules/graceful-fs/polyfills.js
generated
vendored
Normal file
342
node_modules/@jest/source-map/node_modules/graceful-fs/polyfills.js
generated
vendored
Normal file
@@ -0,0 +1,342 @@
|
||||
var constants = require('constants')
|
||||
|
||||
var origCwd = process.cwd
|
||||
var cwd = null
|
||||
|
||||
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform
|
||||
|
||||
process.cwd = function() {
|
||||
if (!cwd)
|
||||
cwd = origCwd.call(process)
|
||||
return cwd
|
||||
}
|
||||
try {
|
||||
process.cwd()
|
||||
} catch (er) {}
|
||||
|
||||
var chdir = process.chdir
|
||||
process.chdir = function(d) {
|
||||
cwd = null
|
||||
chdir.call(process, d)
|
||||
}
|
||||
|
||||
module.exports = patch
|
||||
|
||||
function patch (fs) {
|
||||
// (re-)implement some things that are known busted or missing.
|
||||
|
||||
// lchmod, broken prior to 0.6.2
|
||||
// back-port the fix here.
|
||||
if (constants.hasOwnProperty('O_SYMLINK') &&
|
||||
process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
||||
patchLchmod(fs)
|
||||
}
|
||||
|
||||
// lutimes implementation, or no-op
|
||||
if (!fs.lutimes) {
|
||||
patchLutimes(fs)
|
||||
}
|
||||
|
||||
// https://github.com/isaacs/node-graceful-fs/issues/4
|
||||
// Chown should not fail on einval or eperm if non-root.
|
||||
// It should not fail on enosys ever, as this just indicates
|
||||
// that a fs doesn't support the intended operation.
|
||||
|
||||
fs.chown = chownFix(fs.chown)
|
||||
fs.fchown = chownFix(fs.fchown)
|
||||
fs.lchown = chownFix(fs.lchown)
|
||||
|
||||
fs.chmod = chmodFix(fs.chmod)
|
||||
fs.fchmod = chmodFix(fs.fchmod)
|
||||
fs.lchmod = chmodFix(fs.lchmod)
|
||||
|
||||
fs.chownSync = chownFixSync(fs.chownSync)
|
||||
fs.fchownSync = chownFixSync(fs.fchownSync)
|
||||
fs.lchownSync = chownFixSync(fs.lchownSync)
|
||||
|
||||
fs.chmodSync = chmodFixSync(fs.chmodSync)
|
||||
fs.fchmodSync = chmodFixSync(fs.fchmodSync)
|
||||
fs.lchmodSync = chmodFixSync(fs.lchmodSync)
|
||||
|
||||
fs.stat = statFix(fs.stat)
|
||||
fs.fstat = statFix(fs.fstat)
|
||||
fs.lstat = statFix(fs.lstat)
|
||||
|
||||
fs.statSync = statFixSync(fs.statSync)
|
||||
fs.fstatSync = statFixSync(fs.fstatSync)
|
||||
fs.lstatSync = statFixSync(fs.lstatSync)
|
||||
|
||||
// if lchmod/lchown do not exist, then make them no-ops
|
||||
if (!fs.lchmod) {
|
||||
fs.lchmod = function (path, mode, cb) {
|
||||
if (cb) process.nextTick(cb)
|
||||
}
|
||||
fs.lchmodSync = function () {}
|
||||
}
|
||||
if (!fs.lchown) {
|
||||
fs.lchown = function (path, uid, gid, cb) {
|
||||
if (cb) process.nextTick(cb)
|
||||
}
|
||||
fs.lchownSync = function () {}
|
||||
}
|
||||
|
||||
// on Windows, A/V software can lock the directory, causing this
|
||||
// to fail with an EACCES or EPERM if the directory contains newly
|
||||
// created files. Try again on failure, for up to 60 seconds.
|
||||
|
||||
// Set the timeout this long because some Windows Anti-Virus, such as Parity
|
||||
// bit9, may lock files for up to a minute, causing npm package install
|
||||
// failures. Also, take care to yield the scheduler. Windows scheduling gives
|
||||
// CPU to a busy looping process, which can cause the program causing the lock
|
||||
// contention to be starved of CPU by node, so the contention doesn't resolve.
|
||||
if (platform === "win32") {
|
||||
fs.rename = (function (fs$rename) { return function (from, to, cb) {
|
||||
var start = Date.now()
|
||||
var backoff = 0;
|
||||
fs$rename(from, to, function CB (er) {
|
||||
if (er
|
||||
&& (er.code === "EACCES" || er.code === "EPERM")
|
||||
&& Date.now() - start < 60000) {
|
||||
setTimeout(function() {
|
||||
fs.stat(to, function (stater, st) {
|
||||
if (stater && stater.code === "ENOENT")
|
||||
fs$rename(from, to, CB);
|
||||
else
|
||||
cb(er)
|
||||
})
|
||||
}, backoff)
|
||||
if (backoff < 100)
|
||||
backoff += 10;
|
||||
return;
|
||||
}
|
||||
if (cb) cb(er)
|
||||
})
|
||||
}})(fs.rename)
|
||||
}
|
||||
|
||||
// if read() returns EAGAIN, then just try it again.
|
||||
fs.read = (function (fs$read) {
|
||||
function read (fd, buffer, offset, length, position, callback_) {
|
||||
var callback
|
||||
if (callback_ && typeof callback_ === 'function') {
|
||||
var eagCounter = 0
|
||||
callback = function (er, _, __) {
|
||||
if (er && er.code === 'EAGAIN' && eagCounter < 10) {
|
||||
eagCounter ++
|
||||
return fs$read.call(fs, fd, buffer, offset, length, position, callback)
|
||||
}
|
||||
callback_.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
return fs$read.call(fs, fd, buffer, offset, length, position, callback)
|
||||
}
|
||||
|
||||
// This ensures `util.promisify` works as it does for native `fs.read`.
|
||||
read.__proto__ = fs$read
|
||||
return read
|
||||
})(fs.read)
|
||||
|
||||
fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
|
||||
var eagCounter = 0
|
||||
while (true) {
|
||||
try {
|
||||
return fs$readSync.call(fs, fd, buffer, offset, length, position)
|
||||
} catch (er) {
|
||||
if (er.code === 'EAGAIN' && eagCounter < 10) {
|
||||
eagCounter ++
|
||||
continue
|
||||
}
|
||||
throw er
|
||||
}
|
||||
}
|
||||
}})(fs.readSync)
|
||||
|
||||
function patchLchmod (fs) {
|
||||
fs.lchmod = function (path, mode, callback) {
|
||||
fs.open( path
|
||||
, constants.O_WRONLY | constants.O_SYMLINK
|
||||
, mode
|
||||
, function (err, fd) {
|
||||
if (err) {
|
||||
if (callback) callback(err)
|
||||
return
|
||||
}
|
||||
// prefer to return the chmod error, if one occurs,
|
||||
// but still try to close, and report closing errors if they occur.
|
||||
fs.fchmod(fd, mode, function (err) {
|
||||
fs.close(fd, function(err2) {
|
||||
if (callback) callback(err || err2)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
fs.lchmodSync = function (path, mode) {
|
||||
var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
|
||||
|
||||
// prefer to return the chmod error, if one occurs,
|
||||
// but still try to close, and report closing errors if they occur.
|
||||
var threw = true
|
||||
var ret
|
||||
try {
|
||||
ret = fs.fchmodSync(fd, mode)
|
||||
threw = false
|
||||
} finally {
|
||||
if (threw) {
|
||||
try {
|
||||
fs.closeSync(fd)
|
||||
} catch (er) {}
|
||||
} else {
|
||||
fs.closeSync(fd)
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
}
|
||||
|
||||
function patchLutimes (fs) {
|
||||
if (constants.hasOwnProperty("O_SYMLINK")) {
|
||||
fs.lutimes = function (path, at, mt, cb) {
|
||||
fs.open(path, constants.O_SYMLINK, function (er, fd) {
|
||||
if (er) {
|
||||
if (cb) cb(er)
|
||||
return
|
||||
}
|
||||
fs.futimes(fd, at, mt, function (er) {
|
||||
fs.close(fd, function (er2) {
|
||||
if (cb) cb(er || er2)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
fs.lutimesSync = function (path, at, mt) {
|
||||
var fd = fs.openSync(path, constants.O_SYMLINK)
|
||||
var ret
|
||||
var threw = true
|
||||
try {
|
||||
ret = fs.futimesSync(fd, at, mt)
|
||||
threw = false
|
||||
} finally {
|
||||
if (threw) {
|
||||
try {
|
||||
fs.closeSync(fd)
|
||||
} catch (er) {}
|
||||
} else {
|
||||
fs.closeSync(fd)
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
} else {
|
||||
fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
|
||||
fs.lutimesSync = function () {}
|
||||
}
|
||||
}
|
||||
|
||||
function chmodFix (orig) {
|
||||
if (!orig) return orig
|
||||
return function (target, mode, cb) {
|
||||
return orig.call(fs, target, mode, function (er) {
|
||||
if (chownErOk(er)) er = null
|
||||
if (cb) cb.apply(this, arguments)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function chmodFixSync (orig) {
|
||||
if (!orig) return orig
|
||||
return function (target, mode) {
|
||||
try {
|
||||
return orig.call(fs, target, mode)
|
||||
} catch (er) {
|
||||
if (!chownErOk(er)) throw er
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function chownFix (orig) {
|
||||
if (!orig) return orig
|
||||
return function (target, uid, gid, cb) {
|
||||
return orig.call(fs, target, uid, gid, function (er) {
|
||||
if (chownErOk(er)) er = null
|
||||
if (cb) cb.apply(this, arguments)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function chownFixSync (orig) {
|
||||
if (!orig) return orig
|
||||
return function (target, uid, gid) {
|
||||
try {
|
||||
return orig.call(fs, target, uid, gid)
|
||||
} catch (er) {
|
||||
if (!chownErOk(er)) throw er
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function statFix (orig) {
|
||||
if (!orig) return orig
|
||||
// Older versions of Node erroneously returned signed integers for
|
||||
// uid + gid.
|
||||
return function (target, options, cb) {
|
||||
if (typeof options === 'function') {
|
||||
cb = options
|
||||
options = null
|
||||
}
|
||||
function callback (er, stats) {
|
||||
if (stats) {
|
||||
if (stats.uid < 0) stats.uid += 0x100000000
|
||||
if (stats.gid < 0) stats.gid += 0x100000000
|
||||
}
|
||||
if (cb) cb.apply(this, arguments)
|
||||
}
|
||||
return options ? orig.call(fs, target, options, callback)
|
||||
: orig.call(fs, target, callback)
|
||||
}
|
||||
}
|
||||
|
||||
function statFixSync (orig) {
|
||||
if (!orig) return orig
|
||||
// Older versions of Node erroneously returned signed integers for
|
||||
// uid + gid.
|
||||
return function (target, options) {
|
||||
var stats = options ? orig.call(fs, target, options)
|
||||
: orig.call(fs, target)
|
||||
if (stats.uid < 0) stats.uid += 0x100000000
|
||||
if (stats.gid < 0) stats.gid += 0x100000000
|
||||
return stats;
|
||||
}
|
||||
}
|
||||
|
||||
// ENOSYS means that the fs doesn't support the op. Just ignore
|
||||
// that, because it doesn't matter.
|
||||
//
|
||||
// if there's no getuid, or if getuid() is something other
|
||||
// than 0, and the error is EINVAL or EPERM, then just ignore
|
||||
// it.
|
||||
//
|
||||
// This specific case is a silent failure in cp, install, tar,
|
||||
// and most other unix tools that manage permissions.
|
||||
//
|
||||
// When running as root, or if other types of errors are
|
||||
// encountered, then it's strict.
|
||||
function chownErOk (er) {
|
||||
if (!er)
|
||||
return true
|
||||
|
||||
if (er.code === "ENOSYS")
|
||||
return true
|
||||
|
||||
var nonroot = !process.getuid || process.getuid() !== 0
|
||||
if (nonroot) {
|
||||
if (er.code === "EINVAL" || er.code === "EPERM")
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
59
node_modules/@jest/source-map/package.json
generated
vendored
Normal file
59
node_modules/@jest/source-map/package.json
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"_from": "@jest/source-map@^25.1.0",
|
||||
"_id": "@jest/source-map@25.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ohf2iKT0xnLWcIUhL6U6QN+CwFWf9XnrM2a6ybL9NXxJjgYijjLSitkYHIdzkd8wFliH73qj/+epIpTiWjRtAA==",
|
||||
"_location": "/@jest/source-map",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@jest/source-map@^25.1.0",
|
||||
"name": "@jest/source-map",
|
||||
"escapedName": "@jest%2fsource-map",
|
||||
"scope": "@jest",
|
||||
"rawSpec": "^25.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^25.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@jest/console",
|
||||
"/jest-jasmine2",
|
||||
"/jest-runtime"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-25.1.0.tgz",
|
||||
"_shasum": "b012e6c469ccdbc379413f5c1b1ffb7ba7034fb0",
|
||||
"_spec": "@jest/source-map@^25.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx/node_modules/jest-runtime",
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"callsites": "^3.0.0",
|
||||
"graceful-fs": "^4.2.3",
|
||||
"source-map": "^0.6.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"devDependencies": {
|
||||
"@types/graceful-fs": "^4.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.3"
|
||||
},
|
||||
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638",
|
||||
"homepage": "https://github.com/facebook/jest#readme",
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "@jest/source-map",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-source-map"
|
||||
},
|
||||
"types": "build/index.d.ts",
|
||||
"version": "25.1.0"
|
||||
}
|
||||
21
node_modules/@jest/test-result/LICENSE
generated
vendored
Normal file
21
node_modules/@jest/test-result/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
||||
9
node_modules/@jest/test-result/build/formatTestResults.d.ts
generated
vendored
Normal file
9
node_modules/@jest/test-result/build/formatTestResults.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* 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, CodeCoverageFormatter, CodeCoverageReporter, FormattedTestResults } from './types';
|
||||
export default function formatTestResults(results: AggregatedResult, codeCoverageFormatter?: CodeCoverageFormatter, reporter?: CodeCoverageReporter): FormattedTestResults;
|
||||
//# sourceMappingURL=formatTestResults.d.ts.map
|
||||
1
node_modules/@jest/test-result/build/formatTestResults.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/test-result/build/formatTestResults.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"formatTestResults.d.ts","sourceRoot":"","sources":["../src/formatTestResults.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,gBAAgB,EAEhB,qBAAqB,EACrB,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAwDjB,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,OAAO,EAAE,gBAAgB,EACzB,qBAAqB,CAAC,EAAE,qBAAqB,EAC7C,QAAQ,CAAC,EAAE,oBAAoB,GAC9B,oBAAoB,CAMtB"}
|
||||
121
node_modules/@jest/test-result/build/formatTestResults.js
generated
vendored
Normal file
121
node_modules/@jest/test-result/build/formatTestResults.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = formatTestResults;
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly)
|
||||
symbols = symbols.filter(function(sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function(key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function(key) {
|
||||
Object.defineProperty(
|
||||
target,
|
||||
key,
|
||||
Object.getOwnPropertyDescriptor(source, key)
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 formatTestResult = (testResult, codeCoverageFormatter, reporter) => {
|
||||
const assertionResults = testResult.testResults.map(formatTestAssertion);
|
||||
|
||||
if (testResult.testExecError) {
|
||||
const now = Date.now();
|
||||
return {
|
||||
assertionResults,
|
||||
coverage: {},
|
||||
endTime: now,
|
||||
message: testResult.failureMessage
|
||||
? testResult.failureMessage
|
||||
: testResult.testExecError.message,
|
||||
name: testResult.testFilePath,
|
||||
startTime: now,
|
||||
status: 'failed',
|
||||
summary: ''
|
||||
};
|
||||
} else {
|
||||
const allTestsPassed = testResult.numFailingTests === 0;
|
||||
return {
|
||||
assertionResults,
|
||||
coverage: codeCoverageFormatter
|
||||
? codeCoverageFormatter(testResult.coverage, reporter)
|
||||
: testResult.coverage,
|
||||
endTime: testResult.perfStats.end,
|
||||
message: testResult.failureMessage || '',
|
||||
name: testResult.testFilePath,
|
||||
startTime: testResult.perfStats.start,
|
||||
status: allTestsPassed ? 'passed' : 'failed',
|
||||
summary: ''
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
function formatTestAssertion(assertion) {
|
||||
const result = {
|
||||
ancestorTitles: assertion.ancestorTitles,
|
||||
failureMessages: null,
|
||||
fullName: assertion.fullName,
|
||||
location: assertion.location,
|
||||
status: assertion.status,
|
||||
title: assertion.title
|
||||
};
|
||||
|
||||
if (assertion.failureMessages) {
|
||||
result.failureMessages = assertion.failureMessages;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function formatTestResults(results, codeCoverageFormatter, reporter) {
|
||||
const testResults = results.testResults.map(testResult =>
|
||||
formatTestResult(testResult, codeCoverageFormatter, reporter)
|
||||
);
|
||||
return _objectSpread({}, results, {
|
||||
testResults
|
||||
});
|
||||
}
|
||||
12
node_modules/@jest/test-result/build/helpers.d.ts
generated
vendored
Normal file
12
node_modules/@jest/test-result/build/helpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 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, SerializableError, TestResult } from './types';
|
||||
export declare const makeEmptyAggregatedTestResult: () => AggregatedResult;
|
||||
export declare const buildFailureTestResult: (testPath: string, err: SerializableError) => TestResult;
|
||||
export declare const addResult: (aggregatedResults: AggregatedResult, testResult: TestResult) => void;
|
||||
export declare const createEmptyTestResult: () => TestResult;
|
||||
//# sourceMappingURL=helpers.d.ts.map
|
||||
1
node_modules/@jest/test-result/build/helpers.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/test-result/build/helpers.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC;AAExE,eAAO,MAAM,6BAA6B,wBAiCxC,CAAC;AAEH,eAAO,MAAM,sBAAsB,0DA+BjC,CAAC;AAGH,eAAO,MAAM,SAAS,uEAmErB,CAAC;AAEF,eAAO,MAAM,qBAAqB,kBAuBhC,CAAC"}
|
||||
181
node_modules/@jest/test-result/build/helpers.js
generated
vendored
Normal file
181
node_modules/@jest/test-result/build/helpers.js
generated
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.createEmptyTestResult = exports.addResult = exports.buildFailureTestResult = exports.makeEmptyAggregatedTestResult = void 0;
|
||||
|
||||
/**
|
||||
* 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 makeEmptyAggregatedTestResult = () => ({
|
||||
numFailedTestSuites: 0,
|
||||
numFailedTests: 0,
|
||||
numPassedTestSuites: 0,
|
||||
numPassedTests: 0,
|
||||
numPendingTestSuites: 0,
|
||||
numPendingTests: 0,
|
||||
numRuntimeErrorTestSuites: 0,
|
||||
numTodoTests: 0,
|
||||
numTotalTestSuites: 0,
|
||||
numTotalTests: 0,
|
||||
openHandles: [],
|
||||
snapshot: {
|
||||
added: 0,
|
||||
didUpdate: false,
|
||||
// is set only after the full run
|
||||
failure: false,
|
||||
filesAdded: 0,
|
||||
// combines individual test results + removed files after the full run
|
||||
filesRemoved: 0,
|
||||
filesRemovedList: [],
|
||||
filesUnmatched: 0,
|
||||
filesUpdated: 0,
|
||||
matched: 0,
|
||||
total: 0,
|
||||
unchecked: 0,
|
||||
uncheckedKeysByFile: [],
|
||||
unmatched: 0,
|
||||
updated: 0
|
||||
},
|
||||
startTime: 0,
|
||||
success: true,
|
||||
testResults: [],
|
||||
wasInterrupted: false
|
||||
});
|
||||
|
||||
exports.makeEmptyAggregatedTestResult = makeEmptyAggregatedTestResult;
|
||||
|
||||
const buildFailureTestResult = (testPath, err) => ({
|
||||
console: undefined,
|
||||
displayName: '',
|
||||
failureMessage: null,
|
||||
leaks: false,
|
||||
numFailingTests: 0,
|
||||
numPassingTests: 0,
|
||||
numPendingTests: 0,
|
||||
numTodoTests: 0,
|
||||
openHandles: [],
|
||||
perfStats: {
|
||||
end: 0,
|
||||
start: 0
|
||||
},
|
||||
skipped: false,
|
||||
snapshot: {
|
||||
added: 0,
|
||||
fileDeleted: false,
|
||||
matched: 0,
|
||||
unchecked: 0,
|
||||
uncheckedKeys: [],
|
||||
unmatched: 0,
|
||||
updated: 0
|
||||
},
|
||||
sourceMaps: {},
|
||||
testExecError: err,
|
||||
testFilePath: testPath,
|
||||
testResults: []
|
||||
}); // Add individual test result to an aggregated test result
|
||||
|
||||
exports.buildFailureTestResult = buildFailureTestResult;
|
||||
|
||||
const addResult = (aggregatedResults, testResult) => {
|
||||
// `todos` are new as of Jest 24, and not all runners return it.
|
||||
// Set it to `0` to avoid `NaN`
|
||||
if (!testResult.numTodoTests) {
|
||||
testResult.numTodoTests = 0;
|
||||
}
|
||||
|
||||
aggregatedResults.testResults.push(testResult);
|
||||
aggregatedResults.numTotalTests +=
|
||||
testResult.numPassingTests +
|
||||
testResult.numFailingTests +
|
||||
testResult.numPendingTests +
|
||||
testResult.numTodoTests;
|
||||
aggregatedResults.numFailedTests += testResult.numFailingTests;
|
||||
aggregatedResults.numPassedTests += testResult.numPassingTests;
|
||||
aggregatedResults.numPendingTests += testResult.numPendingTests;
|
||||
aggregatedResults.numTodoTests += testResult.numTodoTests;
|
||||
|
||||
if (testResult.testExecError) {
|
||||
aggregatedResults.numRuntimeErrorTestSuites++;
|
||||
}
|
||||
|
||||
if (testResult.skipped) {
|
||||
aggregatedResults.numPendingTestSuites++;
|
||||
} else if (testResult.numFailingTests > 0 || testResult.testExecError) {
|
||||
aggregatedResults.numFailedTestSuites++;
|
||||
} else {
|
||||
aggregatedResults.numPassedTestSuites++;
|
||||
} // Snapshot data
|
||||
|
||||
if (testResult.snapshot.added) {
|
||||
aggregatedResults.snapshot.filesAdded++;
|
||||
}
|
||||
|
||||
if (testResult.snapshot.fileDeleted) {
|
||||
aggregatedResults.snapshot.filesRemoved++;
|
||||
}
|
||||
|
||||
if (testResult.snapshot.unmatched) {
|
||||
aggregatedResults.snapshot.filesUnmatched++;
|
||||
}
|
||||
|
||||
if (testResult.snapshot.updated) {
|
||||
aggregatedResults.snapshot.filesUpdated++;
|
||||
}
|
||||
|
||||
aggregatedResults.snapshot.added += testResult.snapshot.added;
|
||||
aggregatedResults.snapshot.matched += testResult.snapshot.matched;
|
||||
aggregatedResults.snapshot.unchecked += testResult.snapshot.unchecked;
|
||||
|
||||
if (
|
||||
testResult.snapshot.uncheckedKeys &&
|
||||
testResult.snapshot.uncheckedKeys.length > 0
|
||||
) {
|
||||
aggregatedResults.snapshot.uncheckedKeysByFile.push({
|
||||
filePath: testResult.testFilePath,
|
||||
keys: testResult.snapshot.uncheckedKeys
|
||||
});
|
||||
}
|
||||
|
||||
aggregatedResults.snapshot.unmatched += testResult.snapshot.unmatched;
|
||||
aggregatedResults.snapshot.updated += testResult.snapshot.updated;
|
||||
aggregatedResults.snapshot.total +=
|
||||
testResult.snapshot.added +
|
||||
testResult.snapshot.matched +
|
||||
testResult.snapshot.unmatched +
|
||||
testResult.snapshot.updated;
|
||||
};
|
||||
|
||||
exports.addResult = addResult;
|
||||
|
||||
const createEmptyTestResult = () => ({
|
||||
leaks: false,
|
||||
// That's legacy code, just adding it as needed for typing
|
||||
numFailingTests: 0,
|
||||
numPassingTests: 0,
|
||||
numPendingTests: 0,
|
||||
numTodoTests: 0,
|
||||
openHandles: [],
|
||||
perfStats: {
|
||||
end: 0,
|
||||
start: 0
|
||||
},
|
||||
skipped: false,
|
||||
snapshot: {
|
||||
added: 0,
|
||||
fileDeleted: false,
|
||||
matched: 0,
|
||||
unchecked: 0,
|
||||
uncheckedKeys: [],
|
||||
unmatched: 0,
|
||||
updated: 0
|
||||
},
|
||||
testFilePath: '',
|
||||
testResults: []
|
||||
});
|
||||
|
||||
exports.createEmptyTestResult = createEmptyTestResult;
|
||||
10
node_modules/@jest/test-result/build/index.d.ts
generated
vendored
Normal file
10
node_modules/@jest/test-result/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* 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 formatTestResults } from './formatTestResults';
|
||||
export { addResult, buildFailureTestResult, createEmptyTestResult, makeEmptyAggregatedTestResult, } from './helpers';
|
||||
export { AggregatedResult, AssertionLocation, AssertionResult, FailedAssertion, FormattedTestResults, Milliseconds, SerializableError, SnapshotSummary, Status, Suite, TestResult, V8CoverageResult, } from './types';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@jest/test-result/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/test-result/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,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,MAAM,EACN,KAAK,EACL,UAAU,EACV,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
|
||||
117
node_modules/@jest/test-result/build/index.js
generated
vendored
Normal file
117
node_modules/@jest/test-result/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'formatTestResults', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _formatTestResults.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'addResult', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _helpers.addResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'buildFailureTestResult', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _helpers.buildFailureTestResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'createEmptyTestResult', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _helpers.createEmptyTestResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'makeEmptyAggregatedTestResult', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _helpers.makeEmptyAggregatedTestResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'AggregatedResult', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.AggregatedResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'AssertionLocation', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.AssertionLocation;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'AssertionResult', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.AssertionResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'FailedAssertion', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.FailedAssertion;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'FormattedTestResults', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.FormattedTestResults;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'Milliseconds', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.Milliseconds;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'SerializableError', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.SerializableError;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'SnapshotSummary', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.SnapshotSummary;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'Status', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.Status;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'Suite', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.Suite;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'TestResult', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.TestResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'V8CoverageResult', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.V8CoverageResult;
|
||||
}
|
||||
});
|
||||
|
||||
var _formatTestResults = _interopRequireDefault(require('./formatTestResults'));
|
||||
|
||||
var _helpers = require('./helpers');
|
||||
|
||||
var _types = require('./types');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
173
node_modules/@jest/test-result/build/types.d.ts
generated
vendored
Normal file
173
node_modules/@jest/test-result/build/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
/**
|
||||
* 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 { CoverageMap, CoverageMapData } from 'istanbul-lib-coverage';
|
||||
import { ConsoleBuffer } from '@jest/console';
|
||||
import { Config } from '@jest/types';
|
||||
import { V8Coverage } from 'collect-v8-coverage';
|
||||
import { TransformResult } from '@jest/transform';
|
||||
export declare type V8CoverageResult = Array<{
|
||||
codeTransformResult: TransformResult | undefined;
|
||||
result: V8Coverage[number];
|
||||
}>;
|
||||
export declare type SerializableError = {
|
||||
code?: unknown;
|
||||
message: string;
|
||||
stack: string | null | undefined;
|
||||
type?: string;
|
||||
};
|
||||
export declare type FailedAssertion = {
|
||||
matcherName?: string;
|
||||
message?: string;
|
||||
actual?: any;
|
||||
pass?: boolean;
|
||||
passed?: boolean;
|
||||
expected?: any;
|
||||
isNot?: boolean;
|
||||
stack?: string;
|
||||
error?: any;
|
||||
};
|
||||
export declare type AssertionLocation = {
|
||||
fullName: string;
|
||||
path: string;
|
||||
};
|
||||
export declare type Status = 'passed' | 'failed' | 'skipped' | 'pending' | 'todo' | 'disabled';
|
||||
export declare type Bytes = number;
|
||||
export declare type Milliseconds = number;
|
||||
declare type Callsite = {
|
||||
column: number;
|
||||
line: number;
|
||||
};
|
||||
export declare type AssertionResult = {
|
||||
ancestorTitles: Array<string>;
|
||||
duration?: Milliseconds | null | undefined;
|
||||
failureMessages: Array<string>;
|
||||
fullName: string;
|
||||
invocations?: number;
|
||||
location: Callsite | null | undefined;
|
||||
numPassingAsserts: number;
|
||||
status: Status;
|
||||
title: string;
|
||||
};
|
||||
export declare type FormattedAssertionResult = {
|
||||
ancestorTitles: Array<string>;
|
||||
failureMessages: Array<string> | null;
|
||||
fullName: string;
|
||||
location: Callsite | null | undefined;
|
||||
status: Status;
|
||||
title: string;
|
||||
};
|
||||
export declare type AggregatedResultWithoutCoverage = {
|
||||
numFailedTests: number;
|
||||
numFailedTestSuites: number;
|
||||
numPassedTests: number;
|
||||
numPassedTestSuites: number;
|
||||
numPendingTests: number;
|
||||
numTodoTests: number;
|
||||
numPendingTestSuites: number;
|
||||
numRuntimeErrorTestSuites: number;
|
||||
numTotalTests: number;
|
||||
numTotalTestSuites: number;
|
||||
openHandles: Array<Error>;
|
||||
snapshot: SnapshotSummary;
|
||||
startTime: number;
|
||||
success: boolean;
|
||||
testResults: Array<TestResult>;
|
||||
wasInterrupted: boolean;
|
||||
};
|
||||
export declare type AggregatedResult = AggregatedResultWithoutCoverage & {
|
||||
coverageMap?: CoverageMap | null;
|
||||
};
|
||||
export declare type Suite = {
|
||||
title: string;
|
||||
suites: Array<Suite>;
|
||||
tests: Array<AssertionResult>;
|
||||
};
|
||||
export declare type TestResult = {
|
||||
console?: ConsoleBuffer;
|
||||
coverage?: CoverageMapData;
|
||||
displayName?: Config.DisplayName;
|
||||
failureMessage?: string | null;
|
||||
leaks: boolean;
|
||||
memoryUsage?: Bytes;
|
||||
numFailingTests: number;
|
||||
numPassingTests: number;
|
||||
numPendingTests: number;
|
||||
numTodoTests: number;
|
||||
openHandles: Array<Error>;
|
||||
perfStats: {
|
||||
end: Milliseconds;
|
||||
start: Milliseconds;
|
||||
};
|
||||
skipped: boolean;
|
||||
snapshot: {
|
||||
added: number;
|
||||
fileDeleted: boolean;
|
||||
matched: number;
|
||||
unchecked: number;
|
||||
uncheckedKeys: Array<string>;
|
||||
unmatched: number;
|
||||
updated: number;
|
||||
};
|
||||
sourceMaps?: {
|
||||
[sourcePath: string]: string;
|
||||
};
|
||||
testExecError?: SerializableError;
|
||||
testFilePath: string;
|
||||
testResults: Array<AssertionResult>;
|
||||
v8Coverage?: V8CoverageResult;
|
||||
};
|
||||
export declare type FormattedTestResult = {
|
||||
message: string;
|
||||
name: string;
|
||||
summary: string;
|
||||
status: 'failed' | 'passed';
|
||||
startTime: number;
|
||||
endTime: number;
|
||||
coverage: any;
|
||||
assertionResults: Array<FormattedAssertionResult>;
|
||||
};
|
||||
export declare type FormattedTestResults = {
|
||||
coverageMap?: CoverageMap | null | undefined;
|
||||
numFailedTests: number;
|
||||
numFailedTestSuites: number;
|
||||
numPassedTests: number;
|
||||
numPassedTestSuites: number;
|
||||
numPendingTests: number;
|
||||
numPendingTestSuites: number;
|
||||
numRuntimeErrorTestSuites: number;
|
||||
numTotalTests: number;
|
||||
numTotalTestSuites: number;
|
||||
snapshot: SnapshotSummary;
|
||||
startTime: number;
|
||||
success: boolean;
|
||||
testResults: Array<FormattedTestResult>;
|
||||
wasInterrupted: boolean;
|
||||
};
|
||||
export declare type CodeCoverageReporter = any;
|
||||
export declare type CodeCoverageFormatter = (coverage: CoverageMapData | null | undefined, reporter: CodeCoverageReporter) => Record<string, any> | null | undefined;
|
||||
export declare type UncheckedSnapshot = {
|
||||
filePath: string;
|
||||
keys: Array<string>;
|
||||
};
|
||||
export declare type SnapshotSummary = {
|
||||
added: number;
|
||||
didUpdate: boolean;
|
||||
failure: boolean;
|
||||
filesAdded: number;
|
||||
filesRemoved: number;
|
||||
filesRemovedList: Array<string>;
|
||||
filesUnmatched: number;
|
||||
filesUpdated: number;
|
||||
matched: number;
|
||||
total: number;
|
||||
unchecked: number;
|
||||
uncheckedKeysByFile: Array<UncheckedSnapshot>;
|
||||
unmatched: number;
|
||||
updated: number;
|
||||
};
|
||||
export {};
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
1
node_modules/@jest/test-result/build/types.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/test-result/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;AAGH,OAAO,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAEhD,oBAAY,gBAAgB,GAAG,KAAK,CAAC;IACnC,mBAAmB,EAAE,eAAe,GAAG,SAAS,CAAC;IACjD,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;CAC5B,CAAC,CAAC;AAEH,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,MAAM,GACd,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,GACT,MAAM,GACN,UAAU,CAAC;AAEf,oBAAY,KAAK,GAAG,MAAM,CAAC;AAE3B,oBAAY,YAAY,GAAG,MAAM,CAAC;AAClC,aAAK,QAAQ,GAAG;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,+BAA+B,GAAG;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yBAAyB,EAAE,MAAM,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,oBAAY,gBAAgB,GAAG,+BAA+B,GAAG;IAC/D,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,oBAAY,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;CAC/B,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,SAAS,EAAE;QACT,GAAG,EAAE,YAAY,CAAC;QAClB,KAAK,EAAE,YAAY,CAAC;KACrB,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,OAAO,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,CAAC,EAAE;QACX,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;KAC9B,CAAC;IACF,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC;IACd,gBAAgB,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;CACnD,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7C,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yBAAyB,EAAE,MAAM,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACxC,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,oBAAY,oBAAoB,GAAG,GAAG,CAAC;AAEvC,oBAAY,qBAAqB,GAAG,CAClC,QAAQ,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EAC5C,QAAQ,EAAE,oBAAoB,KAC3B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAE5C,oBAAY,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
||||
1
node_modules/@jest/test-result/build/types.js
generated
vendored
Normal file
1
node_modules/@jest/test-result/build/types.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
'use strict';
|
||||
60
node_modules/@jest/test-result/package.json
generated
vendored
Normal file
60
node_modules/@jest/test-result/package.json
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"_from": "@jest/test-result@^25.1.0",
|
||||
"_id": "@jest/test-result@25.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-FZzSo36h++U93vNWZ0KgvlNuZ9pnDnztvaM7P/UcTx87aPDotG18bXifkf1Ji44B7k/eIatmMzkBapnAzjkJkg==",
|
||||
"_location": "/@jest/test-result",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@jest/test-result@^25.1.0",
|
||||
"name": "@jest/test-result",
|
||||
"escapedName": "@jest%2ftest-result",
|
||||
"scope": "@jest",
|
||||
"rawSpec": "^25.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^25.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@jest/test-sequencer",
|
||||
"/jest-jasmine2",
|
||||
"/jest-message-util",
|
||||
"/jest-runner",
|
||||
"/jest-runtime"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-25.1.0.tgz",
|
||||
"_shasum": "847af2972c1df9822a8200457e64be4ff62821f7",
|
||||
"_spec": "@jest/test-result@^25.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx/node_modules/jest-runtime",
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@jest/console": "^25.1.0",
|
||||
"@jest/transform": "^25.1.0",
|
||||
"@jest/types": "^25.1.0",
|
||||
"@types/istanbul-lib-coverage": "^2.0.0",
|
||||
"collect-v8-coverage": "^1.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"engines": {
|
||||
"node": ">= 8.3"
|
||||
},
|
||||
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638",
|
||||
"homepage": "https://github.com/facebook/jest#readme",
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "@jest/test-result",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-test-result"
|
||||
},
|
||||
"types": "build/index.d.ts",
|
||||
"version": "25.1.0"
|
||||
}
|
||||
21
node_modules/@jest/test-sequencer/LICENSE
generated
vendored
Normal file
21
node_modules/@jest/test-sequencer/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
||||
52
node_modules/@jest/test-sequencer/build/index.d.ts
generated
vendored
Normal file
52
node_modules/@jest/test-sequencer/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* 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 } from '@jest/test-result';
|
||||
import { Context } from 'jest-runtime';
|
||||
import { Test } from 'jest-runner';
|
||||
declare type Cache = {
|
||||
[key: string]: [0 | 1, number];
|
||||
};
|
||||
/**
|
||||
* The TestSequencer will ultimately decide which tests should run first.
|
||||
* It is responsible for storing and reading from a local cache
|
||||
* map that stores context information for a given test, such as how long it
|
||||
* took to run during the last run and if it has failed or not.
|
||||
* Such information is used on:
|
||||
* TestSequencer.sort(tests: Array<Test>)
|
||||
* to sort the order of the provided tests.
|
||||
*
|
||||
* After the results are collected,
|
||||
* TestSequencer.cacheResults(tests: Array<Test>, results: AggregatedResult)
|
||||
* is called to store/update this information on the cache map.
|
||||
*/
|
||||
export default class TestSequencer {
|
||||
private _cache;
|
||||
_getCachePath(context: Context): string;
|
||||
_getCache(test: Test): Cache;
|
||||
/**
|
||||
* Sorting tests is very important because it has a great impact on the
|
||||
* user-perceived responsiveness and speed of the test run.
|
||||
*
|
||||
* If such information is on cache, tests are sorted based on:
|
||||
* -> Has it failed during the last run ?
|
||||
* Since it's important to provide the most expected feedback as quickly
|
||||
* as possible.
|
||||
* -> How long it took to run ?
|
||||
* Because running long tests first is an effort to minimize worker idle
|
||||
* time at the end of a long test run.
|
||||
* And if that information is not available they are sorted based on file size
|
||||
* since big test files usually take longer to complete.
|
||||
*
|
||||
* Note that a possible improvement would be to analyse other information
|
||||
* from the file other than its size.
|
||||
*
|
||||
*/
|
||||
sort(tests: Array<Test>): Array<Test>;
|
||||
cacheResults(tests: Array<Test>, results: AggregatedResult): void;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@jest/test-sequencer/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/test-sequencer/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;AAGH,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAKjC,aAAK,KAAK,GAAG;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,MAAM,CAAkC;IAEhD,aAAa,CAAC,OAAO,EAAE,OAAO;IAK9B,SAAS,CAAC,IAAI,EAAE,IAAI;IAuBpB;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;IA6BrC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,gBAAgB;CAkB3D"}
|
||||
213
node_modules/@jest/test-sequencer/build/index.js
generated
vendored
Normal file
213
node_modules/@jest/test-sequencer/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,213 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function fs() {
|
||||
const data = _interopRequireWildcard(require('fs'));
|
||||
|
||||
fs = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestHasteMap() {
|
||||
const data = require('jest-haste-map');
|
||||
|
||||
_jestHasteMap = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function() {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
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 = 0;
|
||||
const SUCCESS = 1;
|
||||
|
||||
/**
|
||||
* The TestSequencer will ultimately decide which tests should run first.
|
||||
* It is responsible for storing and reading from a local cache
|
||||
* map that stores context information for a given test, such as how long it
|
||||
* took to run during the last run and if it has failed or not.
|
||||
* Such information is used on:
|
||||
* TestSequencer.sort(tests: Array<Test>)
|
||||
* to sort the order of the provided tests.
|
||||
*
|
||||
* After the results are collected,
|
||||
* TestSequencer.cacheResults(tests: Array<Test>, results: AggregatedResult)
|
||||
* is called to store/update this information on the cache map.
|
||||
*/
|
||||
class TestSequencer {
|
||||
constructor() {
|
||||
_defineProperty(this, '_cache', new Map());
|
||||
}
|
||||
|
||||
_getCachePath(context) {
|
||||
const {config} = context;
|
||||
return (0, _jestHasteMap().getCacheFilePath)(
|
||||
config.cacheDirectory,
|
||||
'perf-cache-' + config.name
|
||||
);
|
||||
}
|
||||
|
||||
_getCache(test) {
|
||||
const {context} = test;
|
||||
|
||||
if (!this._cache.has(context) && context.config.cache) {
|
||||
const cachePath = this._getCachePath(context);
|
||||
|
||||
if (fs().existsSync(cachePath)) {
|
||||
try {
|
||||
this._cache.set(
|
||||
context,
|
||||
JSON.parse(fs().readFileSync(cachePath, 'utf8'))
|
||||
);
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
let cache = this._cache.get(context);
|
||||
|
||||
if (!cache) {
|
||||
cache = {};
|
||||
|
||||
this._cache.set(context, cache);
|
||||
}
|
||||
|
||||
return cache;
|
||||
}
|
||||
/**
|
||||
* Sorting tests is very important because it has a great impact on the
|
||||
* user-perceived responsiveness and speed of the test run.
|
||||
*
|
||||
* If such information is on cache, tests are sorted based on:
|
||||
* -> Has it failed during the last run ?
|
||||
* Since it's important to provide the most expected feedback as quickly
|
||||
* as possible.
|
||||
* -> How long it took to run ?
|
||||
* Because running long tests first is an effort to minimize worker idle
|
||||
* time at the end of a long test run.
|
||||
* And if that information is not available they are sorted based on file size
|
||||
* since big test files usually take longer to complete.
|
||||
*
|
||||
* Note that a possible improvement would be to analyse other information
|
||||
* from the file other than its size.
|
||||
*
|
||||
*/
|
||||
|
||||
sort(tests) {
|
||||
const stats = {};
|
||||
|
||||
const fileSize = ({path, context: {hasteFS}}) =>
|
||||
stats[path] || (stats[path] = hasteFS.getSize(path) || 0);
|
||||
|
||||
const hasFailed = (cache, test) =>
|
||||
cache[test.path] && cache[test.path][0] === FAIL;
|
||||
|
||||
const time = (cache, test) => cache[test.path] && cache[test.path][1];
|
||||
|
||||
tests.forEach(test => (test.duration = time(this._getCache(test), test)));
|
||||
return tests.sort((testA, testB) => {
|
||||
const cacheA = this._getCache(testA);
|
||||
|
||||
const cacheB = this._getCache(testB);
|
||||
|
||||
const failedA = hasFailed(cacheA, testA);
|
||||
const failedB = hasFailed(cacheB, testB);
|
||||
const hasTimeA = testA.duration != null;
|
||||
|
||||
if (failedA !== failedB) {
|
||||
return failedA ? -1 : 1;
|
||||
} else if (hasTimeA != (testB.duration != null)) {
|
||||
// If only one of two tests has timing information, run it last
|
||||
return hasTimeA ? 1 : -1;
|
||||
} else if (testA.duration != null && testB.duration != null) {
|
||||
return testA.duration < testB.duration ? 1 : -1;
|
||||
} else {
|
||||
return fileSize(testA) < fileSize(testB) ? 1 : -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
cacheResults(tests, results) {
|
||||
const map = Object.create(null);
|
||||
tests.forEach(test => (map[test.path] = test));
|
||||
results.testResults.forEach(testResult => {
|
||||
if (testResult && map[testResult.testFilePath] && !testResult.skipped) {
|
||||
const cache = this._getCache(map[testResult.testFilePath]);
|
||||
|
||||
const perf = testResult.perfStats;
|
||||
cache[testResult.testFilePath] = [
|
||||
testResult.numFailingTests ? FAIL : SUCCESS,
|
||||
perf.end - perf.start || 0
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
this._cache.forEach((cache, context) =>
|
||||
fs().writeFileSync(this._getCachePath(context), JSON.stringify(cache))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = TestSequencer;
|
||||
55
node_modules/@jest/test-sequencer/package.json
generated
vendored
Normal file
55
node_modules/@jest/test-sequencer/package.json
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"_from": "@jest/test-sequencer@^25.1.0",
|
||||
"_id": "@jest/test-sequencer@25.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-WgZLRgVr2b4l/7ED1J1RJQBOharxS11EFhmwDqknpknE0Pm87HLZVS2Asuuw+HQdfQvm2aXL2FvvBLxOD1D0iw==",
|
||||
"_location": "/@jest/test-sequencer",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@jest/test-sequencer@^25.1.0",
|
||||
"name": "@jest/test-sequencer",
|
||||
"escapedName": "@jest%2ftest-sequencer",
|
||||
"scope": "@jest",
|
||||
"rawSpec": "^25.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^25.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/jest-config"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-25.1.0.tgz",
|
||||
"_shasum": "4df47208542f0065f356fcdb80026e3c042851ab",
|
||||
"_spec": "@jest/test-sequencer@^25.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx/node_modules/jest-config",
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@jest/test-result": "^25.1.0",
|
||||
"jest-haste-map": "^25.1.0",
|
||||
"jest-runner": "^25.1.0",
|
||||
"jest-runtime": "^25.1.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"engines": {
|
||||
"node": ">= 8.3"
|
||||
},
|
||||
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638",
|
||||
"homepage": "https://github.com/facebook/jest#readme",
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "@jest/test-sequencer",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-test-sequencer"
|
||||
},
|
||||
"types": "build/index.d.ts",
|
||||
"version": "25.1.0"
|
||||
}
|
||||
21
node_modules/@jest/transform/LICENSE
generated
vendored
Normal file
21
node_modules/@jest/transform/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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/transform/build/ScriptTransformer.d.ts
generated
vendored
Normal file
39
node_modules/@jest/transform/build/ScriptTransformer.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 { Options, TransformResult } from './types';
|
||||
export default class ScriptTransformer {
|
||||
private _cache;
|
||||
private _config;
|
||||
private _transformCache;
|
||||
private _transformConfigCache;
|
||||
constructor(config: Config.ProjectConfig);
|
||||
private _getCacheKey;
|
||||
private _getFileCachePath;
|
||||
private _getTransformPath;
|
||||
private _getTransformer;
|
||||
private _instrumentFile;
|
||||
private _getRealPath;
|
||||
preloadTransformer(filepath: Config.Path): void;
|
||||
transformSource(filepath: Config.Path, content: string, instrument: boolean): {
|
||||
code: string;
|
||||
mapCoverage: boolean;
|
||||
sourceMapPath: string | null;
|
||||
};
|
||||
private _transformAndBuildScript;
|
||||
transform(filename: Config.Path, options: Options, fileSource?: string): TransformResult;
|
||||
transformJson(filename: Config.Path, options: Options, fileSource: string): string;
|
||||
requireAndTranspileModule<ModuleType = unknown>(moduleName: string, callback?: (module: ModuleType) => void): ModuleType;
|
||||
requireAndTranspileModule<ModuleType = unknown>(moduleName: string, callback?: (module: ModuleType) => Promise<void>): Promise<ModuleType>;
|
||||
/**
|
||||
* @deprecated use `this.shouldTransform` instead
|
||||
*/
|
||||
private _shouldTransform;
|
||||
shouldTransform(filename: Config.Path): boolean;
|
||||
}
|
||||
export declare function createTranspilingRequire(config: Config.ProjectConfig): <TModuleType = unknown>(resolverPath: string, applyInteropRequireDefault?: boolean) => TModuleType;
|
||||
//# sourceMappingURL=ScriptTransformer.d.ts.map
|
||||
1
node_modules/@jest/transform/build/ScriptTransformer.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/transform/build/ScriptTransformer.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ScriptTransformer.d.ts","sourceRoot":"","sources":["../src/ScriptTransformer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAanC,OAAO,EACL,OAAO,EACP,eAAe,EAGhB,MAAM,SAAS,CAAC;AAiCjB,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,qBAAqB,CAA4B;gBAE7C,MAAM,EAAE,MAAM,CAAC,aAAa;IAsBxC,OAAO,CAAC,YAAY;IA8BpB,OAAO,CAAC,iBAAiB;IAyBzB,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,eAAe;IAgCvB,OAAO,CAAC,eAAe;IAmCvB,OAAO,CAAC,YAAY;IAUpB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI;IAI/C,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO;;;;;IAiG3E,OAAO,CAAC,wBAAwB;IA6ChC,SAAS,CACP,QAAQ,EAAE,MAAM,CAAC,IAAI,EACrB,OAAO,EAAE,OAAO,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,eAAe;IA6BlB,aAAa,CACX,QAAQ,EAAE,MAAM,CAAC,IAAI,EACrB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM;IAkBT,yBAAyB,CAAC,UAAU,GAAG,OAAO,EAC5C,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,GACtC,UAAU;IACb,yBAAyB,CAAC,UAAU,GAAG,OAAO,EAC5C,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,GAC/C,OAAO,CAAC,UAAU,CAAC;IAsDtB;;OAEG;IAEH,OAAO,CAAC,gBAAgB;IAIxB,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,GAAG,OAAO;CAQhD;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,sGAepE"}
|
||||
828
node_modules/@jest/transform/build/ScriptTransformer.js
generated
vendored
Normal file
828
node_modules/@jest/transform/build/ScriptTransformer.js
generated
vendored
Normal file
@@ -0,0 +1,828 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.createTranspilingRequire = createTranspilingRequire;
|
||||
exports.default = void 0;
|
||||
|
||||
function _crypto() {
|
||||
const data = require('crypto');
|
||||
|
||||
_crypto = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require('path'));
|
||||
|
||||
path = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function fs() {
|
||||
const data = _interopRequireWildcard(require('graceful-fs'));
|
||||
|
||||
fs = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _core() {
|
||||
const data = require('@babel/core');
|
||||
|
||||
_core = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _babelPluginIstanbul() {
|
||||
const data = _interopRequireDefault(require('babel-plugin-istanbul'));
|
||||
|
||||
_babelPluginIstanbul = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _convertSourceMap() {
|
||||
const data = require('convert-source-map');
|
||||
|
||||
_convertSourceMap = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestHasteMap() {
|
||||
const data = _interopRequireDefault(require('jest-haste-map'));
|
||||
|
||||
_jestHasteMap = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fastJsonStableStringify() {
|
||||
const data = _interopRequireDefault(require('fast-json-stable-stringify'));
|
||||
|
||||
_fastJsonStableStringify = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _slash() {
|
||||
const data = _interopRequireDefault(require('slash'));
|
||||
|
||||
_slash = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _writeFileAtomic() {
|
||||
const data = require('write-file-atomic');
|
||||
|
||||
_writeFileAtomic = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _realpathNative() {
|
||||
const data = require('realpath-native');
|
||||
|
||||
_realpathNative = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _pirates() {
|
||||
const data = require('pirates');
|
||||
|
||||
_pirates = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _shouldInstrument = _interopRequireDefault(require('./shouldInstrument'));
|
||||
|
||||
var _enhanceUnexpectedTokenMessage = _interopRequireDefault(
|
||||
require('./enhanceUnexpectedTokenMessage')
|
||||
);
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function() {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// Use `require` to avoid TS rootDir
|
||||
const {version: VERSION} = require('../package.json'); // This data structure is used to avoid recalculating some data every time that
|
||||
// we need to transform a file. Since ScriptTransformer is instantiated for each
|
||||
// file we need to keep this object in the local scope of this module.
|
||||
|
||||
const projectCaches = new Map(); // To reset the cache for specific changesets (rather than package version).
|
||||
|
||||
const CACHE_VERSION = '1';
|
||||
|
||||
async function waitForPromiseWithCleanup(promise, cleanup) {
|
||||
try {
|
||||
await promise;
|
||||
} finally {
|
||||
cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
class ScriptTransformer {
|
||||
constructor(config) {
|
||||
_defineProperty(this, '_cache', void 0);
|
||||
|
||||
_defineProperty(this, '_config', void 0);
|
||||
|
||||
_defineProperty(this, '_transformCache', void 0);
|
||||
|
||||
_defineProperty(this, '_transformConfigCache', void 0);
|
||||
|
||||
this._config = config;
|
||||
this._transformCache = new Map();
|
||||
this._transformConfigCache = new Map();
|
||||
const configString = (0, _fastJsonStableStringify().default)(this._config);
|
||||
let projectCache = projectCaches.get(configString);
|
||||
|
||||
if (!projectCache) {
|
||||
projectCache = {
|
||||
configString,
|
||||
ignorePatternsRegExp: calcIgnorePatternRegExp(this._config),
|
||||
transformRegExp: calcTransformRegExp(this._config),
|
||||
transformedFiles: new Map()
|
||||
};
|
||||
projectCaches.set(configString, projectCache);
|
||||
}
|
||||
|
||||
this._cache = projectCache;
|
||||
}
|
||||
|
||||
_getCacheKey(fileData, filename, instrument) {
|
||||
const configString = this._cache.configString;
|
||||
|
||||
const transformer = this._getTransformer(filename);
|
||||
|
||||
if (transformer && typeof transformer.getCacheKey === 'function') {
|
||||
return (0, _crypto().createHash)('md5')
|
||||
.update(
|
||||
transformer.getCacheKey(fileData, filename, configString, {
|
||||
config: this._config,
|
||||
instrument,
|
||||
rootDir: this._config.rootDir
|
||||
})
|
||||
)
|
||||
.update(CACHE_VERSION)
|
||||
.digest('hex');
|
||||
} else {
|
||||
return (0, _crypto().createHash)('md5')
|
||||
.update(fileData)
|
||||
.update(configString)
|
||||
.update(instrument ? 'instrument' : '')
|
||||
.update(filename)
|
||||
.update(CACHE_VERSION)
|
||||
.digest('hex');
|
||||
}
|
||||
}
|
||||
|
||||
_getFileCachePath(filename, content, instrument) {
|
||||
const baseCacheDir = _jestHasteMap().default.getCacheFilePath(
|
||||
this._config.cacheDirectory,
|
||||
'jest-transform-cache-' + this._config.name,
|
||||
VERSION
|
||||
);
|
||||
|
||||
const cacheKey = this._getCacheKey(content, filename, instrument); // Create sub folders based on the cacheKey to avoid creating one
|
||||
// directory with many files.
|
||||
|
||||
const cacheDir = path().join(baseCacheDir, cacheKey[0] + cacheKey[1]);
|
||||
const cacheFilenamePrefix = path()
|
||||
.basename(filename, path().extname(filename))
|
||||
.replace(/\W/g, '');
|
||||
const cachePath = (0, _slash().default)(
|
||||
path().join(cacheDir, cacheFilenamePrefix + '_' + cacheKey)
|
||||
);
|
||||
(0, _jestUtil().createDirectory)(cacheDir);
|
||||
return cachePath;
|
||||
}
|
||||
|
||||
_getTransformPath(filename) {
|
||||
const transformRegExp = this._cache.transformRegExp;
|
||||
|
||||
if (!transformRegExp) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
for (let i = 0; i < transformRegExp.length; i++) {
|
||||
if (transformRegExp[i][0].test(filename)) {
|
||||
const transformPath = transformRegExp[i][1];
|
||||
|
||||
this._transformConfigCache.set(transformPath, transformRegExp[i][2]);
|
||||
|
||||
return transformPath;
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
_getTransformer(filename) {
|
||||
let transform = null;
|
||||
|
||||
if (!this._config.transform || !this._config.transform.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const transformPath = this._getTransformPath(filename);
|
||||
|
||||
if (transformPath) {
|
||||
const transformer = this._transformCache.get(transformPath);
|
||||
|
||||
if (transformer != null) {
|
||||
return transformer;
|
||||
}
|
||||
|
||||
transform = require(transformPath);
|
||||
|
||||
if (!transform) {
|
||||
throw new TypeError('Jest: a transform must export something.');
|
||||
}
|
||||
|
||||
const transformerConfig = this._transformConfigCache.get(transformPath);
|
||||
|
||||
if (typeof transform.createTransformer === 'function') {
|
||||
transform = transform.createTransformer(transformerConfig);
|
||||
}
|
||||
|
||||
if (typeof transform.process !== 'function') {
|
||||
throw new TypeError(
|
||||
'Jest: a transform must export a `process` function.'
|
||||
);
|
||||
}
|
||||
|
||||
this._transformCache.set(transformPath, transform);
|
||||
}
|
||||
|
||||
return transform;
|
||||
}
|
||||
|
||||
_instrumentFile(filename, content) {
|
||||
const result = (0, _core().transformSync)(content, {
|
||||
auxiliaryCommentBefore: ' istanbul ignore next ',
|
||||
babelrc: false,
|
||||
caller: {
|
||||
name: '@jest/transform',
|
||||
supportsStaticESM: false
|
||||
},
|
||||
configFile: false,
|
||||
filename,
|
||||
plugins: [
|
||||
[
|
||||
_babelPluginIstanbul().default,
|
||||
{
|
||||
compact: false,
|
||||
// files outside `cwd` will not be instrumented
|
||||
cwd: this._config.rootDir,
|
||||
exclude: [],
|
||||
useInlineSourceMaps: false
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
if (result) {
|
||||
const {code} = result;
|
||||
|
||||
if (code) {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
_getRealPath(filepath) {
|
||||
try {
|
||||
return (0, _realpathNative().sync)(filepath) || filepath;
|
||||
} catch (err) {
|
||||
return filepath;
|
||||
}
|
||||
} // We don't want to expose transformers to the outside - this function is just
|
||||
// to warm up `this._transformCache`
|
||||
|
||||
preloadTransformer(filepath) {
|
||||
this._getTransformer(filepath);
|
||||
}
|
||||
|
||||
transformSource(filepath, content, instrument) {
|
||||
const filename = this._getRealPath(filepath);
|
||||
|
||||
const transform = this._getTransformer(filename);
|
||||
|
||||
const cacheFilePath = this._getFileCachePath(filename, content, instrument);
|
||||
|
||||
let sourceMapPath = cacheFilePath + '.map'; // Ignore cache if `config.cache` is set (--no-cache)
|
||||
|
||||
let code = this._config.cache ? readCodeCacheFile(cacheFilePath) : null;
|
||||
const shouldCallTransform = transform && this.shouldTransform(filename); // That means that the transform has a custom instrumentation
|
||||
// logic and will handle it based on `config.collectCoverage` option
|
||||
|
||||
const transformWillInstrument =
|
||||
shouldCallTransform && transform && transform.canInstrument; // If we handle the coverage instrumentation, we should try to map code
|
||||
// coverage against original source with any provided source map
|
||||
|
||||
const mapCoverage = instrument && !transformWillInstrument;
|
||||
|
||||
if (code) {
|
||||
// This is broken: we return the code, and a path for the source map
|
||||
// directly from the cache. But, nothing ensures the source map actually
|
||||
// matches that source code. They could have gotten out-of-sync in case
|
||||
// two separate processes write concurrently to the same cache files.
|
||||
return {
|
||||
code,
|
||||
mapCoverage,
|
||||
sourceMapPath
|
||||
};
|
||||
}
|
||||
|
||||
let transformed = {
|
||||
code: content,
|
||||
map: null
|
||||
};
|
||||
|
||||
if (transform && shouldCallTransform) {
|
||||
const processed = transform.process(content, filename, this._config, {
|
||||
instrument
|
||||
});
|
||||
|
||||
if (typeof processed === 'string') {
|
||||
transformed.code = processed;
|
||||
} else if (processed != null && typeof processed.code === 'string') {
|
||||
transformed = processed;
|
||||
} else {
|
||||
throw new TypeError(
|
||||
"Jest: a transform's `process` function must return a string, " +
|
||||
'or an object with `code` key containing this string.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!transformed.map) {
|
||||
try {
|
||||
//Could be a potential freeze here.
|
||||
//See: https://github.com/facebook/jest/pull/5177#discussion_r158883570
|
||||
const inlineSourceMap = (0, _convertSourceMap().fromSource)(
|
||||
transformed.code
|
||||
);
|
||||
|
||||
if (inlineSourceMap) {
|
||||
transformed.map = inlineSourceMap.toJSON();
|
||||
}
|
||||
} catch (e) {
|
||||
const transformPath = this._getTransformPath(filename);
|
||||
|
||||
console.warn(
|
||||
`jest-transform: The source map produced for the file ${filename} ` +
|
||||
`by ${transformPath} was invalid. Proceeding without source ` +
|
||||
'mapping for that file.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!transformWillInstrument && instrument) {
|
||||
code = this._instrumentFile(filename, transformed.code);
|
||||
} else {
|
||||
code = transformed.code;
|
||||
}
|
||||
|
||||
if (transformed.map) {
|
||||
const sourceMapContent =
|
||||
typeof transformed.map === 'string'
|
||||
? transformed.map
|
||||
: JSON.stringify(transformed.map);
|
||||
writeCacheFile(sourceMapPath, sourceMapContent);
|
||||
} else {
|
||||
sourceMapPath = null;
|
||||
}
|
||||
|
||||
writeCodeCacheFile(cacheFilePath, code);
|
||||
return {
|
||||
code,
|
||||
mapCoverage,
|
||||
sourceMapPath
|
||||
};
|
||||
}
|
||||
|
||||
_transformAndBuildScript(filename, options, instrument, fileSource) {
|
||||
const isInternalModule = !!(options && options.isInternalModule);
|
||||
const isCoreModule = !!(options && options.isCoreModule);
|
||||
const content = stripShebang(
|
||||
fileSource || fs().readFileSync(filename, 'utf8')
|
||||
);
|
||||
let code = content;
|
||||
let sourceMapPath = null;
|
||||
let mapCoverage = false;
|
||||
const willTransform =
|
||||
!isInternalModule &&
|
||||
!isCoreModule &&
|
||||
(this.shouldTransform(filename) || instrument);
|
||||
|
||||
try {
|
||||
if (willTransform) {
|
||||
const transformedSource = this.transformSource(
|
||||
filename,
|
||||
content,
|
||||
instrument
|
||||
);
|
||||
code = transformedSource.code;
|
||||
sourceMapPath = transformedSource.sourceMapPath;
|
||||
mapCoverage = transformedSource.mapCoverage;
|
||||
}
|
||||
|
||||
return {
|
||||
code,
|
||||
mapCoverage,
|
||||
originalCode: content,
|
||||
sourceMapPath
|
||||
};
|
||||
} catch (e) {
|
||||
throw (0, _enhanceUnexpectedTokenMessage.default)(e);
|
||||
}
|
||||
}
|
||||
|
||||
transform(filename, options, fileSource) {
|
||||
let scriptCacheKey = undefined;
|
||||
let instrument = false;
|
||||
|
||||
if (!options.isCoreModule) {
|
||||
instrument =
|
||||
options.coverageProvider === 'babel' &&
|
||||
(0, _shouldInstrument.default)(filename, options, this._config);
|
||||
scriptCacheKey = getScriptCacheKey(filename, instrument);
|
||||
|
||||
const result = this._cache.transformedFiles.get(scriptCacheKey);
|
||||
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
const result = this._transformAndBuildScript(
|
||||
filename,
|
||||
options,
|
||||
instrument,
|
||||
fileSource
|
||||
);
|
||||
|
||||
if (scriptCacheKey) {
|
||||
this._cache.transformedFiles.set(scriptCacheKey, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
transformJson(filename, options, fileSource) {
|
||||
const isInternalModule = options.isInternalModule;
|
||||
const isCoreModule = options.isCoreModule;
|
||||
const willTransform =
|
||||
!isInternalModule && !isCoreModule && this.shouldTransform(filename);
|
||||
|
||||
if (willTransform) {
|
||||
const {code: transformedJsonSource} = this.transformSource(
|
||||
filename,
|
||||
fileSource,
|
||||
false
|
||||
);
|
||||
return transformedJsonSource;
|
||||
}
|
||||
|
||||
return fileSource;
|
||||
}
|
||||
|
||||
requireAndTranspileModule(moduleName, callback) {
|
||||
// Load the transformer to avoid a cycle where we need to load a
|
||||
// transformer in order to transform it in the require hooks
|
||||
this.preloadTransformer(moduleName);
|
||||
let transforming = false;
|
||||
const revertHook = (0, _pirates().addHook)(
|
||||
(code, filename) => {
|
||||
try {
|
||||
transforming = true;
|
||||
return this.transformSource(filename, code, false).code || code;
|
||||
} finally {
|
||||
transforming = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
exts: this._config.moduleFileExtensions.map(ext => `.${ext}`),
|
||||
ignoreNodeModules: false,
|
||||
matcher: filename => {
|
||||
if (transforming) {
|
||||
// Don't transform any dependency required by the transformer itself
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.shouldTransform(filename);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const module = require(moduleName);
|
||||
|
||||
if (!callback) {
|
||||
revertHook();
|
||||
return module;
|
||||
}
|
||||
|
||||
try {
|
||||
const cbResult = callback(module);
|
||||
|
||||
if ((0, _jestUtil().isPromise)(cbResult)) {
|
||||
return waitForPromiseWithCleanup(cbResult, revertHook).then(
|
||||
() => module
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
revertHook();
|
||||
}
|
||||
|
||||
return module;
|
||||
}
|
||||
/**
|
||||
* @deprecated use `this.shouldTransform` instead
|
||||
*/
|
||||
// @ts-ignore: Unused and private - remove in Jest 25
|
||||
|
||||
_shouldTransform(filename) {
|
||||
return this.shouldTransform(filename);
|
||||
}
|
||||
|
||||
shouldTransform(filename) {
|
||||
const ignoreRegexp = this._cache.ignorePatternsRegExp;
|
||||
const isIgnored = ignoreRegexp ? ignoreRegexp.test(filename) : false;
|
||||
return (
|
||||
!!this._config.transform && !!this._config.transform.length && !isIgnored
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = ScriptTransformer;
|
||||
|
||||
function createTranspilingRequire(config) {
|
||||
const transformer = new ScriptTransformer(config);
|
||||
return function requireAndTranspileModule(
|
||||
resolverPath,
|
||||
applyInteropRequireDefault = false
|
||||
) {
|
||||
const transpiledModule = transformer.requireAndTranspileModule(
|
||||
resolverPath
|
||||
);
|
||||
return applyInteropRequireDefault
|
||||
? (0, _jestUtil().interopRequireDefault)(transpiledModule).default
|
||||
: transpiledModule;
|
||||
};
|
||||
}
|
||||
|
||||
const removeFile = path => {
|
||||
try {
|
||||
fs().unlinkSync(path);
|
||||
} catch (e) {}
|
||||
};
|
||||
|
||||
const stripShebang = content => {
|
||||
// If the file data starts with a shebang remove it. Leaves the empty line
|
||||
// to keep stack trace line numbers correct.
|
||||
if (content.startsWith('#!')) {
|
||||
return content.replace(/^#!.*/, '');
|
||||
} else {
|
||||
return content;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* This is like `writeCacheFile` but with an additional sanity checksum. We
|
||||
* cannot use the same technique for source maps because we expose source map
|
||||
* cache file paths directly to callsites, with the expectation they can read
|
||||
* it right away. This is not a great system, because source map cache file
|
||||
* could get corrupted, out-of-sync, etc.
|
||||
*/
|
||||
|
||||
function writeCodeCacheFile(cachePath, code) {
|
||||
const checksum = (0, _crypto().createHash)('md5')
|
||||
.update(code)
|
||||
.digest('hex');
|
||||
writeCacheFile(cachePath, checksum + '\n' + code);
|
||||
}
|
||||
/**
|
||||
* Read counterpart of `writeCodeCacheFile`. We verify that the content of the
|
||||
* file matches the checksum, in case some kind of corruption happened. This
|
||||
* could happen if an older version of `jest-runtime` writes non-atomically to
|
||||
* the same cache, for example.
|
||||
*/
|
||||
|
||||
function readCodeCacheFile(cachePath) {
|
||||
const content = readCacheFile(cachePath);
|
||||
|
||||
if (content == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const code = content.substr(33);
|
||||
const checksum = (0, _crypto().createHash)('md5')
|
||||
.update(code)
|
||||
.digest('hex');
|
||||
|
||||
if (checksum === content.substr(0, 32)) {
|
||||
return code;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Writing to the cache atomically relies on 'rename' being atomic on most
|
||||
* file systems. Doing atomic write reduces the risk of corruption by avoiding
|
||||
* two processes to write to the same file at the same time. It also reduces
|
||||
* the risk of reading a file that's being overwritten at the same time.
|
||||
*/
|
||||
|
||||
const writeCacheFile = (cachePath, fileData) => {
|
||||
try {
|
||||
(0, _writeFileAtomic().sync)(cachePath, fileData, {
|
||||
encoding: 'utf8'
|
||||
});
|
||||
} catch (e) {
|
||||
if (cacheWriteErrorSafeToIgnore(e, cachePath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.message =
|
||||
'jest: failed to cache transform results in: ' +
|
||||
cachePath +
|
||||
'\nFailure message: ' +
|
||||
e.message;
|
||||
removeFile(cachePath);
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* On Windows, renames are not atomic, leading to EPERM exceptions when two
|
||||
* processes attempt to rename to the same target file at the same time.
|
||||
* If the target file exists we can be reasonably sure another process has
|
||||
* legitimately won a cache write race and ignore the error.
|
||||
*/
|
||||
|
||||
const cacheWriteErrorSafeToIgnore = (e, cachePath) =>
|
||||
process.platform === 'win32' &&
|
||||
e.code === 'EPERM' &&
|
||||
fs().existsSync(cachePath);
|
||||
|
||||
const readCacheFile = cachePath => {
|
||||
if (!fs().existsSync(cachePath)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let fileData;
|
||||
|
||||
try {
|
||||
fileData = fs().readFileSync(cachePath, 'utf8');
|
||||
} catch (e) {
|
||||
e.message =
|
||||
'jest: failed to read cache file: ' +
|
||||
cachePath +
|
||||
'\nFailure message: ' +
|
||||
e.message;
|
||||
removeFile(cachePath);
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (fileData == null) {
|
||||
// We must have somehow created the file but failed to write to it,
|
||||
// let's delete it and retry.
|
||||
removeFile(cachePath);
|
||||
}
|
||||
|
||||
return fileData;
|
||||
};
|
||||
|
||||
const getScriptCacheKey = (filename, instrument) => {
|
||||
const mtime = fs().statSync(filename).mtime;
|
||||
return filename + '_' + mtime.getTime() + (instrument ? '_instrumented' : '');
|
||||
};
|
||||
|
||||
const calcIgnorePatternRegExp = config => {
|
||||
if (
|
||||
!config.transformIgnorePatterns ||
|
||||
config.transformIgnorePatterns.length === 0
|
||||
) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return new RegExp(config.transformIgnorePatterns.join('|'));
|
||||
};
|
||||
|
||||
const calcTransformRegExp = config => {
|
||||
if (!config.transform.length) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const transformRegexp = [];
|
||||
|
||||
for (let i = 0; i < config.transform.length; i++) {
|
||||
transformRegexp.push([
|
||||
new RegExp(config.transform[i][0]),
|
||||
config.transform[i][1],
|
||||
config.transform[i][2]
|
||||
]);
|
||||
}
|
||||
|
||||
return transformRegexp;
|
||||
};
|
||||
13
node_modules/@jest/transform/build/enhanceUnexpectedTokenMessage.d.ts
generated
vendored
Normal file
13
node_modules/@jest/transform/build/enhanceUnexpectedTokenMessage.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.
|
||||
*/
|
||||
export default function handlePotentialSyntaxError(e: Error & {
|
||||
codeFrame?: string;
|
||||
}): Error & {
|
||||
codeFrame?: string | undefined;
|
||||
};
|
||||
export declare function enhanceUnexpectedTokenMessage(e: Error): Error;
|
||||
//# sourceMappingURL=enhanceUnexpectedTokenMessage.d.ts.map
|
||||
1
node_modules/@jest/transform/build/enhanceUnexpectedTokenMessage.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/transform/build/enhanceUnexpectedTokenMessage.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"enhanceUnexpectedTokenMessage.d.ts","sourceRoot":"","sources":["../src/enhanceUnexpectedTokenMessage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAChD,CAAC,EAAE,KAAK,GAAG;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC;;EAiBhC;AAED,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,KAAK,SA2BrD"}
|
||||
75
node_modules/@jest/transform/build/enhanceUnexpectedTokenMessage.js
generated
vendored
Normal file
75
node_modules/@jest/transform/build/enhanceUnexpectedTokenMessage.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = handlePotentialSyntaxError;
|
||||
exports.enhanceUnexpectedTokenMessage = enhanceUnexpectedTokenMessage;
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function() {
|
||||
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 DOT = ' \u2022 ';
|
||||
|
||||
function handlePotentialSyntaxError(e) {
|
||||
if (e.codeFrame) {
|
||||
e.stack = e.message + '\n' + e.codeFrame;
|
||||
}
|
||||
|
||||
if (
|
||||
// `instanceof` might come from the wrong context
|
||||
e.name === 'SyntaxError' &&
|
||||
(e.message.includes('Unexpected token') ||
|
||||
e.message.includes('Cannot use import')) &&
|
||||
!e.message.includes(' expected')
|
||||
) {
|
||||
throw enhanceUnexpectedTokenMessage(e);
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
function enhanceUnexpectedTokenMessage(e) {
|
||||
e.stack =
|
||||
`${_chalk().default.bold.red('Jest encountered an unexpected token')}
|
||||
|
||||
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
|
||||
|
||||
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
|
||||
|
||||
Here's what you can do:
|
||||
${DOT}To have some of your "node_modules" files transformed, you can specify a custom ${_chalk().default.bold(
|
||||
'"transformIgnorePatterns"'
|
||||
)} in your config.
|
||||
${DOT}If you need a custom transformation specify a ${_chalk().default.bold(
|
||||
'"transform"'
|
||||
)} option in your config.
|
||||
${DOT}If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the ${_chalk().default.bold(
|
||||
'"moduleNameMapper"'
|
||||
)} config option.
|
||||
|
||||
You'll find more details and examples of these config options in the docs:
|
||||
${_chalk().default.cyan('https://jestjs.io/docs/en/configuration.html')}
|
||||
|
||||
${_chalk().default.bold.red('Details:')}
|
||||
|
||||
` + e.stack;
|
||||
return e;
|
||||
}
|
||||
11
node_modules/@jest/transform/build/index.d.ts
generated
vendored
Normal file
11
node_modules/@jest/transform/build/index.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.
|
||||
*/
|
||||
export { default as ScriptTransformer, createTranspilingRequire, } from './ScriptTransformer';
|
||||
export { default as shouldInstrument } from './shouldInstrument';
|
||||
export { Transformer, ShouldInstrumentOptions, Options as TransformationOptions, TransformResult, } from './types';
|
||||
export { default as handlePotentialSyntaxError } from './enhanceUnexpectedTokenMessage';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@jest/transform/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/transform/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,EACL,OAAO,IAAI,iBAAiB,EAC5B,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,OAAO,IAAI,qBAAqB,EAChC,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAC,OAAO,IAAI,0BAA0B,EAAC,MAAM,iCAAiC,CAAC"}
|
||||
111
node_modules/@jest/transform/build/index.js
generated
vendored
Normal file
111
node_modules/@jest/transform/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'ScriptTransformer', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _ScriptTransformer.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'createTranspilingRequire', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _ScriptTransformer.createTranspilingRequire;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'shouldInstrument', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _shouldInstrument.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'Transformer', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.Transformer;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'ShouldInstrumentOptions', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.ShouldInstrumentOptions;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'TransformationOptions', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.Options;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'TransformResult', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _types.TransformResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'handlePotentialSyntaxError', {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _enhanceUnexpectedTokenMessage.default;
|
||||
}
|
||||
});
|
||||
|
||||
var _ScriptTransformer = _interopRequireWildcard(
|
||||
require('./ScriptTransformer')
|
||||
);
|
||||
|
||||
var _shouldInstrument = _interopRequireDefault(require('./shouldInstrument'));
|
||||
|
||||
var _types = require('./types');
|
||||
|
||||
var _enhanceUnexpectedTokenMessage = _interopRequireDefault(
|
||||
require('./enhanceUnexpectedTokenMessage')
|
||||
);
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function() {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
10
node_modules/@jest/transform/build/shouldInstrument.d.ts
generated
vendored
Normal file
10
node_modules/@jest/transform/build/shouldInstrument.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* 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 { ShouldInstrumentOptions } from './types';
|
||||
export default function shouldInstrument(filename: Config.Path, options: ShouldInstrumentOptions, config: Config.ProjectConfig): boolean;
|
||||
//# sourceMappingURL=shouldInstrument.d.ts.map
|
||||
1
node_modules/@jest/transform/build/shouldInstrument.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/transform/build/shouldInstrument.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"shouldInstrument.d.ts","sourceRoot":"","sources":["../src/shouldInstrument.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAInC,OAAO,EAAC,uBAAuB,EAAC,MAAM,SAAS,CAAC;AAMhD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,QAAQ,EAAE,MAAM,CAAC,IAAI,EACrB,OAAO,EAAE,uBAAuB,EAChC,MAAM,EAAE,MAAM,CAAC,aAAa,GAC3B,OAAO,CA8ET"}
|
||||
191
node_modules/@jest/transform/build/shouldInstrument.js
generated
vendored
Normal file
191
node_modules/@jest/transform/build/shouldInstrument.js
generated
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = shouldInstrument;
|
||||
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require('path'));
|
||||
|
||||
path = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestRegexUtil() {
|
||||
const data = require('jest-regex-util');
|
||||
|
||||
_jestRegexUtil = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _micromatch() {
|
||||
const data = _interopRequireDefault(require('micromatch'));
|
||||
|
||||
_micromatch = function() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function() {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 MOCKS_PATTERN = new RegExp(
|
||||
(0, _jestRegexUtil().escapePathForRegex)(
|
||||
path().sep + '__mocks__' + path().sep
|
||||
)
|
||||
);
|
||||
|
||||
function shouldInstrument(filename, options, config) {
|
||||
if (!options.collectCoverage) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
config.forceCoverageMatch.length &&
|
||||
_micromatch().default.any(filename, config.forceCoverageMatch)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
!config.testPathIgnorePatterns.some(pattern => !!filename.match(pattern))
|
||||
) {
|
||||
if (config.testRegex.some(regex => new RegExp(regex).test(filename))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
(0, _micromatch().default)(
|
||||
[(0, _jestUtil().replacePathSepForGlob)(filename)],
|
||||
config.testMatch
|
||||
).length
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
// This configuration field contains an object in the form of:
|
||||
// {'path/to/file.js': true}
|
||||
options.collectCoverageOnlyFrom &&
|
||||
!options.collectCoverageOnlyFrom[filename]
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
// still cover if `only` is specified
|
||||
!options.collectCoverageOnlyFrom &&
|
||||
options.collectCoverageFrom.length &&
|
||||
(0, _micromatch().default)(
|
||||
[
|
||||
(0, _jestUtil().replacePathSepForGlob)(
|
||||
path().relative(config.rootDir, filename)
|
||||
)
|
||||
],
|
||||
options.collectCoverageFrom
|
||||
).length === 0
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
config.coveragePathIgnorePatterns.some(pattern => !!filename.match(pattern))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (config.globalSetup === filename) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (config.globalTeardown === filename) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (config.setupFiles.includes(filename)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (config.setupFilesAfterEnv.includes(filename)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (MOCKS_PATTERN.test(filename)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.changedFiles && !options.changedFiles.has(filename)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
44
node_modules/@jest/transform/build/types.d.ts
generated
vendored
Normal file
44
node_modules/@jest/transform/build/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* 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 { RawSourceMap } from 'source-map';
|
||||
import { Config } from '@jest/types';
|
||||
export declare type ShouldInstrumentOptions = Pick<Config.GlobalConfig, 'collectCoverage' | 'collectCoverageFrom' | 'collectCoverageOnlyFrom' | 'coverageProvider'> & {
|
||||
changedFiles?: Set<Config.Path>;
|
||||
};
|
||||
export declare type Options = ShouldInstrumentOptions & Partial<{
|
||||
isCoreModule: boolean;
|
||||
isInternalModule: boolean;
|
||||
}>;
|
||||
interface FixedRawSourceMap extends Omit<RawSourceMap, 'version'> {
|
||||
version: number;
|
||||
}
|
||||
export declare type TransformedSource = {
|
||||
code: string;
|
||||
map?: FixedRawSourceMap | string | null;
|
||||
};
|
||||
export declare type TransformResult = {
|
||||
code: string;
|
||||
originalCode: string;
|
||||
mapCoverage: boolean;
|
||||
sourceMapPath: string | null;
|
||||
};
|
||||
export declare type TransformOptions = {
|
||||
instrument: boolean;
|
||||
};
|
||||
export declare type CacheKeyOptions = {
|
||||
config: Config.ProjectConfig;
|
||||
instrument: boolean;
|
||||
rootDir: string;
|
||||
};
|
||||
export interface Transformer {
|
||||
canInstrument?: boolean;
|
||||
createTransformer?: (options?: any) => Transformer;
|
||||
getCacheKey?: (fileData: string, filePath: Config.Path, configStr: string, options: CacheKeyOptions) => string;
|
||||
process: (sourceText: string, sourcePath: Config.Path, config: Config.ProjectConfig, options?: TransformOptions) => string | TransformedSource;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
1
node_modules/@jest/transform/build/types.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/transform/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,YAAY,EAAC,MAAM,YAAY,CAAC;AACxC,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAEnC,oBAAY,uBAAuB,GAAG,IAAI,CACxC,MAAM,CAAC,YAAY,EACjB,iBAAiB,GACjB,qBAAqB,GACrB,yBAAyB,GACzB,kBAAkB,CACrB,GAAG;IACF,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC;AAEF,oBAAY,OAAO,GAAG,uBAAuB,GAC3C,OAAO,CAAC;IACN,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC,CAAC;AAGL,UAAU,iBAAkB,SAAQ,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC;IAC/D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,WAAW,CAAC;IAEnD,WAAW,CAAC,EAAE,CACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,CAAC,IAAI,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,KACrB,MAAM,CAAC;IAEZ,OAAO,EAAE,CACP,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,CAAC,IAAI,EACvB,MAAM,EAAE,MAAM,CAAC,aAAa,EAC5B,OAAO,CAAC,EAAE,gBAAgB,KACvB,MAAM,GAAG,iBAAiB,CAAC;CACjC"}
|
||||
1
node_modules/@jest/transform/build/types.js
generated
vendored
Normal file
1
node_modules/@jest/transform/build/types.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
'use strict';
|
||||
15
node_modules/@jest/transform/node_modules/graceful-fs/LICENSE
generated
vendored
Normal file
15
node_modules/@jest/transform/node_modules/graceful-fs/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
133
node_modules/@jest/transform/node_modules/graceful-fs/README.md
generated
vendored
Normal file
133
node_modules/@jest/transform/node_modules/graceful-fs/README.md
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
# graceful-fs
|
||||
|
||||
graceful-fs functions as a drop-in replacement for the fs module,
|
||||
making various improvements.
|
||||
|
||||
The improvements are meant to normalize behavior across different
|
||||
platforms and environments, and to make filesystem access more
|
||||
resilient to errors.
|
||||
|
||||
## Improvements over [fs module](https://nodejs.org/api/fs.html)
|
||||
|
||||
* Queues up `open` and `readdir` calls, and retries them once
|
||||
something closes if there is an EMFILE error from too many file
|
||||
descriptors.
|
||||
* fixes `lchmod` for Node versions prior to 0.6.2.
|
||||
* implements `fs.lutimes` if possible. Otherwise it becomes a noop.
|
||||
* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or
|
||||
`lchown` if the user isn't root.
|
||||
* makes `lchmod` and `lchown` become noops, if not available.
|
||||
* retries reading a file if `read` results in EAGAIN error.
|
||||
|
||||
On Windows, it retries renaming a file for up to one second if `EACCESS`
|
||||
or `EPERM` error occurs, likely because antivirus software has locked
|
||||
the directory.
|
||||
|
||||
## USAGE
|
||||
|
||||
```javascript
|
||||
// use just like fs
|
||||
var fs = require('graceful-fs')
|
||||
|
||||
// now go and do stuff with it...
|
||||
fs.readFileSync('some-file-or-whatever')
|
||||
```
|
||||
|
||||
## Global Patching
|
||||
|
||||
If you want to patch the global fs module (or any other fs-like
|
||||
module) you can do this:
|
||||
|
||||
```javascript
|
||||
// Make sure to read the caveat below.
|
||||
var realFs = require('fs')
|
||||
var gracefulFs = require('graceful-fs')
|
||||
gracefulFs.gracefulify(realFs)
|
||||
```
|
||||
|
||||
This should only ever be done at the top-level application layer, in
|
||||
order to delay on EMFILE errors from any fs-using dependencies. You
|
||||
should **not** do this in a library, because it can cause unexpected
|
||||
delays in other parts of the program.
|
||||
|
||||
## Changes
|
||||
|
||||
This module is fairly stable at this point, and used by a lot of
|
||||
things. That being said, because it implements a subtle behavior
|
||||
change in a core part of the node API, even modest changes can be
|
||||
extremely breaking, and the versioning is thus biased towards
|
||||
bumping the major when in doubt.
|
||||
|
||||
The main change between major versions has been switching between
|
||||
providing a fully-patched `fs` module vs monkey-patching the node core
|
||||
builtin, and the approach by which a non-monkey-patched `fs` was
|
||||
created.
|
||||
|
||||
The goal is to trade `EMFILE` errors for slower fs operations. So, if
|
||||
you try to open a zillion files, rather than crashing, `open`
|
||||
operations will be queued up and wait for something else to `close`.
|
||||
|
||||
There are advantages to each approach. Monkey-patching the fs means
|
||||
that no `EMFILE` errors can possibly occur anywhere in your
|
||||
application, because everything is using the same core `fs` module,
|
||||
which is patched. However, it can also obviously cause undesirable
|
||||
side-effects, especially if the module is loaded multiple times.
|
||||
|
||||
Implementing a separate-but-identical patched `fs` module is more
|
||||
surgical (and doesn't run the risk of patching multiple times), but
|
||||
also imposes the challenge of keeping in sync with the core module.
|
||||
|
||||
The current approach loads the `fs` module, and then creates a
|
||||
lookalike object that has all the same methods, except a few that are
|
||||
patched. It is safe to use in all versions of Node from 0.8 through
|
||||
7.0.
|
||||
|
||||
### v4
|
||||
|
||||
* Do not monkey-patch the fs module. This module may now be used as a
|
||||
drop-in dep, and users can opt into monkey-patching the fs builtin
|
||||
if their app requires it.
|
||||
|
||||
### v3
|
||||
|
||||
* Monkey-patch fs, because the eval approach no longer works on recent
|
||||
node.
|
||||
* fixed possible type-error throw if rename fails on windows
|
||||
* verify that we *never* get EMFILE errors
|
||||
* Ignore ENOSYS from chmod/chown
|
||||
* clarify that graceful-fs must be used as a drop-in
|
||||
|
||||
### v2.1.0
|
||||
|
||||
* Use eval rather than monkey-patching fs.
|
||||
* readdir: Always sort the results
|
||||
* win32: requeue a file if error has an OK status
|
||||
|
||||
### v2.0
|
||||
|
||||
* A return to monkey patching
|
||||
* wrap process.cwd
|
||||
|
||||
### v1.1
|
||||
|
||||
* wrap readFile
|
||||
* Wrap fs.writeFile.
|
||||
* readdir protection
|
||||
* Don't clobber the fs builtin
|
||||
* Handle fs.read EAGAIN errors by trying again
|
||||
* Expose the curOpen counter
|
||||
* No-op lchown/lchmod if not implemented
|
||||
* fs.rename patch only for win32
|
||||
* Patch fs.rename to handle AV software on Windows
|
||||
* Close #4 Chown should not fail on einval or eperm if non-root
|
||||
* Fix isaacs/fstream#1 Only wrap fs one time
|
||||
* Fix #3 Start at 1024 max files, then back off on EMFILE
|
||||
* lutimes that doens't blow up on Linux
|
||||
* A full on-rewrite using a queue instead of just swallowing the EMFILE error
|
||||
* Wrap Read/Write streams as well
|
||||
|
||||
### 1.0
|
||||
|
||||
* Update engines for node 0.6
|
||||
* Be lstat-graceful on Windows
|
||||
* first
|
||||
19
node_modules/@jest/transform/node_modules/graceful-fs/clone.js
generated
vendored
Normal file
19
node_modules/@jest/transform/node_modules/graceful-fs/clone.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = clone
|
||||
|
||||
function clone (obj) {
|
||||
if (obj === null || typeof obj !== 'object')
|
||||
return obj
|
||||
|
||||
if (obj instanceof Object)
|
||||
var copy = { __proto__: obj.__proto__ }
|
||||
else
|
||||
var copy = Object.create(null)
|
||||
|
||||
Object.getOwnPropertyNames(obj).forEach(function (key) {
|
||||
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
|
||||
})
|
||||
|
||||
return copy
|
||||
}
|
||||
346
node_modules/@jest/transform/node_modules/graceful-fs/graceful-fs.js
generated
vendored
Normal file
346
node_modules/@jest/transform/node_modules/graceful-fs/graceful-fs.js
generated
vendored
Normal file
@@ -0,0 +1,346 @@
|
||||
var fs = require('fs')
|
||||
var polyfills = require('./polyfills.js')
|
||||
var legacy = require('./legacy-streams.js')
|
||||
var clone = require('./clone.js')
|
||||
|
||||
var util = require('util')
|
||||
|
||||
/* istanbul ignore next - node 0.x polyfill */
|
||||
var gracefulQueue
|
||||
var previousSymbol
|
||||
|
||||
/* istanbul ignore else - node 0.x polyfill */
|
||||
if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
|
||||
gracefulQueue = Symbol.for('graceful-fs.queue')
|
||||
// This is used in testing by future versions
|
||||
previousSymbol = Symbol.for('graceful-fs.previous')
|
||||
} else {
|
||||
gracefulQueue = '___graceful-fs.queue'
|
||||
previousSymbol = '___graceful-fs.previous'
|
||||
}
|
||||
|
||||
function noop () {}
|
||||
|
||||
var debug = noop
|
||||
if (util.debuglog)
|
||||
debug = util.debuglog('gfs4')
|
||||
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
|
||||
debug = function() {
|
||||
var m = util.format.apply(util, arguments)
|
||||
m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
|
||||
console.error(m)
|
||||
}
|
||||
|
||||
// Once time initialization
|
||||
if (!global[gracefulQueue]) {
|
||||
// This queue can be shared by multiple loaded instances
|
||||
var queue = []
|
||||
Object.defineProperty(global, gracefulQueue, {
|
||||
get: function() {
|
||||
return queue
|
||||
}
|
||||
})
|
||||
|
||||
// Patch fs.close/closeSync to shared queue version, because we need
|
||||
// to retry() whenever a close happens *anywhere* in the program.
|
||||
// This is essential when multiple graceful-fs instances are
|
||||
// in play at the same time.
|
||||
fs.close = (function (fs$close) {
|
||||
function close (fd, cb) {
|
||||
return fs$close.call(fs, fd, function (err) {
|
||||
// This function uses the graceful-fs shared queue
|
||||
if (!err) {
|
||||
retry()
|
||||
}
|
||||
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
})
|
||||
}
|
||||
|
||||
Object.defineProperty(close, previousSymbol, {
|
||||
value: fs$close
|
||||
})
|
||||
return close
|
||||
})(fs.close)
|
||||
|
||||
fs.closeSync = (function (fs$closeSync) {
|
||||
function closeSync (fd) {
|
||||
// This function uses the graceful-fs shared queue
|
||||
fs$closeSync.apply(fs, arguments)
|
||||
retry()
|
||||
}
|
||||
|
||||
Object.defineProperty(closeSync, previousSymbol, {
|
||||
value: fs$closeSync
|
||||
})
|
||||
return closeSync
|
||||
})(fs.closeSync)
|
||||
|
||||
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
|
||||
process.on('exit', function() {
|
||||
debug(global[gracefulQueue])
|
||||
require('assert').equal(global[gracefulQueue].length, 0)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = patch(clone(fs))
|
||||
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
|
||||
module.exports = patch(fs)
|
||||
fs.__patched = true;
|
||||
}
|
||||
|
||||
function patch (fs) {
|
||||
// Everything that references the open() function needs to be in here
|
||||
polyfills(fs)
|
||||
fs.gracefulify = patch
|
||||
|
||||
fs.createReadStream = createReadStream
|
||||
fs.createWriteStream = createWriteStream
|
||||
var fs$readFile = fs.readFile
|
||||
fs.readFile = readFile
|
||||
function readFile (path, options, cb) {
|
||||
if (typeof options === 'function')
|
||||
cb = options, options = null
|
||||
|
||||
return go$readFile(path, options, cb)
|
||||
|
||||
function go$readFile (path, options, cb) {
|
||||
return fs$readFile(path, options, function (err) {
|
||||
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
|
||||
enqueue([go$readFile, [path, options, cb]])
|
||||
else {
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
retry()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
var fs$writeFile = fs.writeFile
|
||||
fs.writeFile = writeFile
|
||||
function writeFile (path, data, options, cb) {
|
||||
if (typeof options === 'function')
|
||||
cb = options, options = null
|
||||
|
||||
return go$writeFile(path, data, options, cb)
|
||||
|
||||
function go$writeFile (path, data, options, cb) {
|
||||
return fs$writeFile(path, data, options, function (err) {
|
||||
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
|
||||
enqueue([go$writeFile, [path, data, options, cb]])
|
||||
else {
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
retry()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
var fs$appendFile = fs.appendFile
|
||||
if (fs$appendFile)
|
||||
fs.appendFile = appendFile
|
||||
function appendFile (path, data, options, cb) {
|
||||
if (typeof options === 'function')
|
||||
cb = options, options = null
|
||||
|
||||
return go$appendFile(path, data, options, cb)
|
||||
|
||||
function go$appendFile (path, data, options, cb) {
|
||||
return fs$appendFile(path, data, options, function (err) {
|
||||
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
|
||||
enqueue([go$appendFile, [path, data, options, cb]])
|
||||
else {
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
retry()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
var fs$readdir = fs.readdir
|
||||
fs.readdir = readdir
|
||||
function readdir (path, options, cb) {
|
||||
var args = [path]
|
||||
if (typeof options !== 'function') {
|
||||
args.push(options)
|
||||
} else {
|
||||
cb = options
|
||||
}
|
||||
args.push(go$readdir$cb)
|
||||
|
||||
return go$readdir(args)
|
||||
|
||||
function go$readdir$cb (err, files) {
|
||||
if (files && files.sort)
|
||||
files.sort()
|
||||
|
||||
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
|
||||
enqueue([go$readdir, [args]])
|
||||
|
||||
else {
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
retry()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function go$readdir (args) {
|
||||
return fs$readdir.apply(fs, args)
|
||||
}
|
||||
|
||||
if (process.version.substr(0, 4) === 'v0.8') {
|
||||
var legStreams = legacy(fs)
|
||||
ReadStream = legStreams.ReadStream
|
||||
WriteStream = legStreams.WriteStream
|
||||
}
|
||||
|
||||
var fs$ReadStream = fs.ReadStream
|
||||
if (fs$ReadStream) {
|
||||
ReadStream.prototype = Object.create(fs$ReadStream.prototype)
|
||||
ReadStream.prototype.open = ReadStream$open
|
||||
}
|
||||
|
||||
var fs$WriteStream = fs.WriteStream
|
||||
if (fs$WriteStream) {
|
||||
WriteStream.prototype = Object.create(fs$WriteStream.prototype)
|
||||
WriteStream.prototype.open = WriteStream$open
|
||||
}
|
||||
|
||||
Object.defineProperty(fs, 'ReadStream', {
|
||||
get: function () {
|
||||
return ReadStream
|
||||
},
|
||||
set: function (val) {
|
||||
ReadStream = val
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
})
|
||||
Object.defineProperty(fs, 'WriteStream', {
|
||||
get: function () {
|
||||
return WriteStream
|
||||
},
|
||||
set: function (val) {
|
||||
WriteStream = val
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
})
|
||||
|
||||
// legacy names
|
||||
var FileReadStream = ReadStream
|
||||
Object.defineProperty(fs, 'FileReadStream', {
|
||||
get: function () {
|
||||
return FileReadStream
|
||||
},
|
||||
set: function (val) {
|
||||
FileReadStream = val
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
})
|
||||
var FileWriteStream = WriteStream
|
||||
Object.defineProperty(fs, 'FileWriteStream', {
|
||||
get: function () {
|
||||
return FileWriteStream
|
||||
},
|
||||
set: function (val) {
|
||||
FileWriteStream = val
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
})
|
||||
|
||||
function ReadStream (path, options) {
|
||||
if (this instanceof ReadStream)
|
||||
return fs$ReadStream.apply(this, arguments), this
|
||||
else
|
||||
return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
|
||||
}
|
||||
|
||||
function ReadStream$open () {
|
||||
var that = this
|
||||
open(that.path, that.flags, that.mode, function (err, fd) {
|
||||
if (err) {
|
||||
if (that.autoClose)
|
||||
that.destroy()
|
||||
|
||||
that.emit('error', err)
|
||||
} else {
|
||||
that.fd = fd
|
||||
that.emit('open', fd)
|
||||
that.read()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function WriteStream (path, options) {
|
||||
if (this instanceof WriteStream)
|
||||
return fs$WriteStream.apply(this, arguments), this
|
||||
else
|
||||
return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
|
||||
}
|
||||
|
||||
function WriteStream$open () {
|
||||
var that = this
|
||||
open(that.path, that.flags, that.mode, function (err, fd) {
|
||||
if (err) {
|
||||
that.destroy()
|
||||
that.emit('error', err)
|
||||
} else {
|
||||
that.fd = fd
|
||||
that.emit('open', fd)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function createReadStream (path, options) {
|
||||
return new fs.ReadStream(path, options)
|
||||
}
|
||||
|
||||
function createWriteStream (path, options) {
|
||||
return new fs.WriteStream(path, options)
|
||||
}
|
||||
|
||||
var fs$open = fs.open
|
||||
fs.open = open
|
||||
function open (path, flags, mode, cb) {
|
||||
if (typeof mode === 'function')
|
||||
cb = mode, mode = null
|
||||
|
||||
return go$open(path, flags, mode, cb)
|
||||
|
||||
function go$open (path, flags, mode, cb) {
|
||||
return fs$open(path, flags, mode, function (err, fd) {
|
||||
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
|
||||
enqueue([go$open, [path, flags, mode, cb]])
|
||||
else {
|
||||
if (typeof cb === 'function')
|
||||
cb.apply(this, arguments)
|
||||
retry()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return fs
|
||||
}
|
||||
|
||||
function enqueue (elem) {
|
||||
debug('ENQUEUE', elem[0].name, elem[1])
|
||||
global[gracefulQueue].push(elem)
|
||||
}
|
||||
|
||||
function retry () {
|
||||
var elem = global[gracefulQueue].shift()
|
||||
if (elem) {
|
||||
debug('RETRY', elem[0].name, elem[1])
|
||||
elem[0].apply(null, elem[1])
|
||||
}
|
||||
}
|
||||
118
node_modules/@jest/transform/node_modules/graceful-fs/legacy-streams.js
generated
vendored
Normal file
118
node_modules/@jest/transform/node_modules/graceful-fs/legacy-streams.js
generated
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
var Stream = require('stream').Stream
|
||||
|
||||
module.exports = legacy
|
||||
|
||||
function legacy (fs) {
|
||||
return {
|
||||
ReadStream: ReadStream,
|
||||
WriteStream: WriteStream
|
||||
}
|
||||
|
||||
function ReadStream (path, options) {
|
||||
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
|
||||
|
||||
Stream.call(this);
|
||||
|
||||
var self = this;
|
||||
|
||||
this.path = path;
|
||||
this.fd = null;
|
||||
this.readable = true;
|
||||
this.paused = false;
|
||||
|
||||
this.flags = 'r';
|
||||
this.mode = 438; /*=0666*/
|
||||
this.bufferSize = 64 * 1024;
|
||||
|
||||
options = options || {};
|
||||
|
||||
// Mixin options into this
|
||||
var keys = Object.keys(options);
|
||||
for (var index = 0, length = keys.length; index < length; index++) {
|
||||
var key = keys[index];
|
||||
this[key] = options[key];
|
||||
}
|
||||
|
||||
if (this.encoding) this.setEncoding(this.encoding);
|
||||
|
||||
if (this.start !== undefined) {
|
||||
if ('number' !== typeof this.start) {
|
||||
throw TypeError('start must be a Number');
|
||||
}
|
||||
if (this.end === undefined) {
|
||||
this.end = Infinity;
|
||||
} else if ('number' !== typeof this.end) {
|
||||
throw TypeError('end must be a Number');
|
||||
}
|
||||
|
||||
if (this.start > this.end) {
|
||||
throw new Error('start must be <= end');
|
||||
}
|
||||
|
||||
this.pos = this.start;
|
||||
}
|
||||
|
||||
if (this.fd !== null) {
|
||||
process.nextTick(function() {
|
||||
self._read();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
fs.open(this.path, this.flags, this.mode, function (err, fd) {
|
||||
if (err) {
|
||||
self.emit('error', err);
|
||||
self.readable = false;
|
||||
return;
|
||||
}
|
||||
|
||||
self.fd = fd;
|
||||
self.emit('open', fd);
|
||||
self._read();
|
||||
})
|
||||
}
|
||||
|
||||
function WriteStream (path, options) {
|
||||
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
|
||||
|
||||
Stream.call(this);
|
||||
|
||||
this.path = path;
|
||||
this.fd = null;
|
||||
this.writable = true;
|
||||
|
||||
this.flags = 'w';
|
||||
this.encoding = 'binary';
|
||||
this.mode = 438; /*=0666*/
|
||||
this.bytesWritten = 0;
|
||||
|
||||
options = options || {};
|
||||
|
||||
// Mixin options into this
|
||||
var keys = Object.keys(options);
|
||||
for (var index = 0, length = keys.length; index < length; index++) {
|
||||
var key = keys[index];
|
||||
this[key] = options[key];
|
||||
}
|
||||
|
||||
if (this.start !== undefined) {
|
||||
if ('number' !== typeof this.start) {
|
||||
throw TypeError('start must be a Number');
|
||||
}
|
||||
if (this.start < 0) {
|
||||
throw new Error('start must be >= zero');
|
||||
}
|
||||
|
||||
this.pos = this.start;
|
||||
}
|
||||
|
||||
this.busy = false;
|
||||
this._queue = [];
|
||||
|
||||
if (this.fd === null) {
|
||||
this._open = fs.open;
|
||||
this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
|
||||
this.flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
79
node_modules/@jest/transform/node_modules/graceful-fs/package.json
generated
vendored
Normal file
79
node_modules/@jest/transform/node_modules/graceful-fs/package.json
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"_from": "graceful-fs@^4.2.3",
|
||||
"_id": "graceful-fs@4.2.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==",
|
||||
"_location": "/@jest/transform/graceful-fs",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "graceful-fs@^4.2.3",
|
||||
"name": "graceful-fs",
|
||||
"escapedName": "graceful-fs",
|
||||
"rawSpec": "^4.2.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^4.2.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@jest/transform"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
|
||||
"_shasum": "4a12ff1b60376ef09862c2093edd908328be8423",
|
||||
"_spec": "graceful-fs@^4.2.3",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx/node_modules/@jest/transform",
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/node-graceful-fs/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "A drop-in replacement for fs, making various improvements.",
|
||||
"devDependencies": {
|
||||
"import-fresh": "^2.0.0",
|
||||
"mkdirp": "^0.5.0",
|
||||
"rimraf": "^2.2.8",
|
||||
"tap": "^12.7.0"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"files": [
|
||||
"fs.js",
|
||||
"graceful-fs.js",
|
||||
"legacy-streams.js",
|
||||
"polyfills.js",
|
||||
"clone.js"
|
||||
],
|
||||
"homepage": "https://github.com/isaacs/node-graceful-fs#readme",
|
||||
"keywords": [
|
||||
"fs",
|
||||
"module",
|
||||
"reading",
|
||||
"retry",
|
||||
"retries",
|
||||
"queue",
|
||||
"error",
|
||||
"errors",
|
||||
"handling",
|
||||
"EMFILE",
|
||||
"EAGAIN",
|
||||
"EINVAL",
|
||||
"EPERM",
|
||||
"EACCESS"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "graceful-fs.js",
|
||||
"name": "graceful-fs",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/isaacs/node-graceful-fs.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "git push origin --follow-tags",
|
||||
"postversion": "npm publish",
|
||||
"preversion": "npm test",
|
||||
"test": "node test.js | tap -"
|
||||
},
|
||||
"version": "4.2.3"
|
||||
}
|
||||
342
node_modules/@jest/transform/node_modules/graceful-fs/polyfills.js
generated
vendored
Normal file
342
node_modules/@jest/transform/node_modules/graceful-fs/polyfills.js
generated
vendored
Normal file
@@ -0,0 +1,342 @@
|
||||
var constants = require('constants')
|
||||
|
||||
var origCwd = process.cwd
|
||||
var cwd = null
|
||||
|
||||
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform
|
||||
|
||||
process.cwd = function() {
|
||||
if (!cwd)
|
||||
cwd = origCwd.call(process)
|
||||
return cwd
|
||||
}
|
||||
try {
|
||||
process.cwd()
|
||||
} catch (er) {}
|
||||
|
||||
var chdir = process.chdir
|
||||
process.chdir = function(d) {
|
||||
cwd = null
|
||||
chdir.call(process, d)
|
||||
}
|
||||
|
||||
module.exports = patch
|
||||
|
||||
function patch (fs) {
|
||||
// (re-)implement some things that are known busted or missing.
|
||||
|
||||
// lchmod, broken prior to 0.6.2
|
||||
// back-port the fix here.
|
||||
if (constants.hasOwnProperty('O_SYMLINK') &&
|
||||
process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
||||
patchLchmod(fs)
|
||||
}
|
||||
|
||||
// lutimes implementation, or no-op
|
||||
if (!fs.lutimes) {
|
||||
patchLutimes(fs)
|
||||
}
|
||||
|
||||
// https://github.com/isaacs/node-graceful-fs/issues/4
|
||||
// Chown should not fail on einval or eperm if non-root.
|
||||
// It should not fail on enosys ever, as this just indicates
|
||||
// that a fs doesn't support the intended operation.
|
||||
|
||||
fs.chown = chownFix(fs.chown)
|
||||
fs.fchown = chownFix(fs.fchown)
|
||||
fs.lchown = chownFix(fs.lchown)
|
||||
|
||||
fs.chmod = chmodFix(fs.chmod)
|
||||
fs.fchmod = chmodFix(fs.fchmod)
|
||||
fs.lchmod = chmodFix(fs.lchmod)
|
||||
|
||||
fs.chownSync = chownFixSync(fs.chownSync)
|
||||
fs.fchownSync = chownFixSync(fs.fchownSync)
|
||||
fs.lchownSync = chownFixSync(fs.lchownSync)
|
||||
|
||||
fs.chmodSync = chmodFixSync(fs.chmodSync)
|
||||
fs.fchmodSync = chmodFixSync(fs.fchmodSync)
|
||||
fs.lchmodSync = chmodFixSync(fs.lchmodSync)
|
||||
|
||||
fs.stat = statFix(fs.stat)
|
||||
fs.fstat = statFix(fs.fstat)
|
||||
fs.lstat = statFix(fs.lstat)
|
||||
|
||||
fs.statSync = statFixSync(fs.statSync)
|
||||
fs.fstatSync = statFixSync(fs.fstatSync)
|
||||
fs.lstatSync = statFixSync(fs.lstatSync)
|
||||
|
||||
// if lchmod/lchown do not exist, then make them no-ops
|
||||
if (!fs.lchmod) {
|
||||
fs.lchmod = function (path, mode, cb) {
|
||||
if (cb) process.nextTick(cb)
|
||||
}
|
||||
fs.lchmodSync = function () {}
|
||||
}
|
||||
if (!fs.lchown) {
|
||||
fs.lchown = function (path, uid, gid, cb) {
|
||||
if (cb) process.nextTick(cb)
|
||||
}
|
||||
fs.lchownSync = function () {}
|
||||
}
|
||||
|
||||
// on Windows, A/V software can lock the directory, causing this
|
||||
// to fail with an EACCES or EPERM if the directory contains newly
|
||||
// created files. Try again on failure, for up to 60 seconds.
|
||||
|
||||
// Set the timeout this long because some Windows Anti-Virus, such as Parity
|
||||
// bit9, may lock files for up to a minute, causing npm package install
|
||||
// failures. Also, take care to yield the scheduler. Windows scheduling gives
|
||||
// CPU to a busy looping process, which can cause the program causing the lock
|
||||
// contention to be starved of CPU by node, so the contention doesn't resolve.
|
||||
if (platform === "win32") {
|
||||
fs.rename = (function (fs$rename) { return function (from, to, cb) {
|
||||
var start = Date.now()
|
||||
var backoff = 0;
|
||||
fs$rename(from, to, function CB (er) {
|
||||
if (er
|
||||
&& (er.code === "EACCES" || er.code === "EPERM")
|
||||
&& Date.now() - start < 60000) {
|
||||
setTimeout(function() {
|
||||
fs.stat(to, function (stater, st) {
|
||||
if (stater && stater.code === "ENOENT")
|
||||
fs$rename(from, to, CB);
|
||||
else
|
||||
cb(er)
|
||||
})
|
||||
}, backoff)
|
||||
if (backoff < 100)
|
||||
backoff += 10;
|
||||
return;
|
||||
}
|
||||
if (cb) cb(er)
|
||||
})
|
||||
}})(fs.rename)
|
||||
}
|
||||
|
||||
// if read() returns EAGAIN, then just try it again.
|
||||
fs.read = (function (fs$read) {
|
||||
function read (fd, buffer, offset, length, position, callback_) {
|
||||
var callback
|
||||
if (callback_ && typeof callback_ === 'function') {
|
||||
var eagCounter = 0
|
||||
callback = function (er, _, __) {
|
||||
if (er && er.code === 'EAGAIN' && eagCounter < 10) {
|
||||
eagCounter ++
|
||||
return fs$read.call(fs, fd, buffer, offset, length, position, callback)
|
||||
}
|
||||
callback_.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
return fs$read.call(fs, fd, buffer, offset, length, position, callback)
|
||||
}
|
||||
|
||||
// This ensures `util.promisify` works as it does for native `fs.read`.
|
||||
read.__proto__ = fs$read
|
||||
return read
|
||||
})(fs.read)
|
||||
|
||||
fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
|
||||
var eagCounter = 0
|
||||
while (true) {
|
||||
try {
|
||||
return fs$readSync.call(fs, fd, buffer, offset, length, position)
|
||||
} catch (er) {
|
||||
if (er.code === 'EAGAIN' && eagCounter < 10) {
|
||||
eagCounter ++
|
||||
continue
|
||||
}
|
||||
throw er
|
||||
}
|
||||
}
|
||||
}})(fs.readSync)
|
||||
|
||||
function patchLchmod (fs) {
|
||||
fs.lchmod = function (path, mode, callback) {
|
||||
fs.open( path
|
||||
, constants.O_WRONLY | constants.O_SYMLINK
|
||||
, mode
|
||||
, function (err, fd) {
|
||||
if (err) {
|
||||
if (callback) callback(err)
|
||||
return
|
||||
}
|
||||
// prefer to return the chmod error, if one occurs,
|
||||
// but still try to close, and report closing errors if they occur.
|
||||
fs.fchmod(fd, mode, function (err) {
|
||||
fs.close(fd, function(err2) {
|
||||
if (callback) callback(err || err2)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
fs.lchmodSync = function (path, mode) {
|
||||
var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
|
||||
|
||||
// prefer to return the chmod error, if one occurs,
|
||||
// but still try to close, and report closing errors if they occur.
|
||||
var threw = true
|
||||
var ret
|
||||
try {
|
||||
ret = fs.fchmodSync(fd, mode)
|
||||
threw = false
|
||||
} finally {
|
||||
if (threw) {
|
||||
try {
|
||||
fs.closeSync(fd)
|
||||
} catch (er) {}
|
||||
} else {
|
||||
fs.closeSync(fd)
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
}
|
||||
|
||||
function patchLutimes (fs) {
|
||||
if (constants.hasOwnProperty("O_SYMLINK")) {
|
||||
fs.lutimes = function (path, at, mt, cb) {
|
||||
fs.open(path, constants.O_SYMLINK, function (er, fd) {
|
||||
if (er) {
|
||||
if (cb) cb(er)
|
||||
return
|
||||
}
|
||||
fs.futimes(fd, at, mt, function (er) {
|
||||
fs.close(fd, function (er2) {
|
||||
if (cb) cb(er || er2)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
fs.lutimesSync = function (path, at, mt) {
|
||||
var fd = fs.openSync(path, constants.O_SYMLINK)
|
||||
var ret
|
||||
var threw = true
|
||||
try {
|
||||
ret = fs.futimesSync(fd, at, mt)
|
||||
threw = false
|
||||
} finally {
|
||||
if (threw) {
|
||||
try {
|
||||
fs.closeSync(fd)
|
||||
} catch (er) {}
|
||||
} else {
|
||||
fs.closeSync(fd)
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
} else {
|
||||
fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
|
||||
fs.lutimesSync = function () {}
|
||||
}
|
||||
}
|
||||
|
||||
function chmodFix (orig) {
|
||||
if (!orig) return orig
|
||||
return function (target, mode, cb) {
|
||||
return orig.call(fs, target, mode, function (er) {
|
||||
if (chownErOk(er)) er = null
|
||||
if (cb) cb.apply(this, arguments)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function chmodFixSync (orig) {
|
||||
if (!orig) return orig
|
||||
return function (target, mode) {
|
||||
try {
|
||||
return orig.call(fs, target, mode)
|
||||
} catch (er) {
|
||||
if (!chownErOk(er)) throw er
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function chownFix (orig) {
|
||||
if (!orig) return orig
|
||||
return function (target, uid, gid, cb) {
|
||||
return orig.call(fs, target, uid, gid, function (er) {
|
||||
if (chownErOk(er)) er = null
|
||||
if (cb) cb.apply(this, arguments)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function chownFixSync (orig) {
|
||||
if (!orig) return orig
|
||||
return function (target, uid, gid) {
|
||||
try {
|
||||
return orig.call(fs, target, uid, gid)
|
||||
} catch (er) {
|
||||
if (!chownErOk(er)) throw er
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function statFix (orig) {
|
||||
if (!orig) return orig
|
||||
// Older versions of Node erroneously returned signed integers for
|
||||
// uid + gid.
|
||||
return function (target, options, cb) {
|
||||
if (typeof options === 'function') {
|
||||
cb = options
|
||||
options = null
|
||||
}
|
||||
function callback (er, stats) {
|
||||
if (stats) {
|
||||
if (stats.uid < 0) stats.uid += 0x100000000
|
||||
if (stats.gid < 0) stats.gid += 0x100000000
|
||||
}
|
||||
if (cb) cb.apply(this, arguments)
|
||||
}
|
||||
return options ? orig.call(fs, target, options, callback)
|
||||
: orig.call(fs, target, callback)
|
||||
}
|
||||
}
|
||||
|
||||
function statFixSync (orig) {
|
||||
if (!orig) return orig
|
||||
// Older versions of Node erroneously returned signed integers for
|
||||
// uid + gid.
|
||||
return function (target, options) {
|
||||
var stats = options ? orig.call(fs, target, options)
|
||||
: orig.call(fs, target)
|
||||
if (stats.uid < 0) stats.uid += 0x100000000
|
||||
if (stats.gid < 0) stats.gid += 0x100000000
|
||||
return stats;
|
||||
}
|
||||
}
|
||||
|
||||
// ENOSYS means that the fs doesn't support the op. Just ignore
|
||||
// that, because it doesn't matter.
|
||||
//
|
||||
// if there's no getuid, or if getuid() is something other
|
||||
// than 0, and the error is EINVAL or EPERM, then just ignore
|
||||
// it.
|
||||
//
|
||||
// This specific case is a silent failure in cp, install, tar,
|
||||
// and most other unix tools that manage permissions.
|
||||
//
|
||||
// When running as root, or if other types of errors are
|
||||
// encountered, then it's strict.
|
||||
function chownErOk (er) {
|
||||
if (!er)
|
||||
return true
|
||||
|
||||
if (er.code === "ENOSYS")
|
||||
return true
|
||||
|
||||
var nonroot = !process.getuid || process.getuid() !== 0
|
||||
if (nonroot) {
|
||||
if (er.code === "EINVAL" || er.code === "EPERM")
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
77
node_modules/@jest/transform/package.json
generated
vendored
Normal file
77
node_modules/@jest/transform/package.json
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"_from": "@jest/transform@^25.1.0",
|
||||
"_id": "@jest/transform@25.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-4ktrQ2TPREVeM+KxB4zskAT84SnmG1vaz4S+51aTefyqn3zocZUnliLLm5Fsl85I3p/kFPN4CRp1RElIfXGegQ==",
|
||||
"_location": "/@jest/transform",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@jest/transform@^25.1.0",
|
||||
"name": "@jest/transform",
|
||||
"escapedName": "@jest%2ftransform",
|
||||
"scope": "@jest",
|
||||
"rawSpec": "^25.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^25.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@jest/test-result",
|
||||
"/babel-jest",
|
||||
"/jest-runtime"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@jest/transform/-/transform-25.1.0.tgz",
|
||||
"_shasum": "221f354f512b4628d88ce776d5b9e601028ea9da",
|
||||
"_spec": "@jest/transform@^25.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx/node_modules/jest-runtime",
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.1.0",
|
||||
"@jest/types": "^25.1.0",
|
||||
"babel-plugin-istanbul": "^6.0.0",
|
||||
"chalk": "^3.0.0",
|
||||
"convert-source-map": "^1.4.0",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"graceful-fs": "^4.2.3",
|
||||
"jest-haste-map": "^25.1.0",
|
||||
"jest-regex-util": "^25.1.0",
|
||||
"jest-util": "^25.1.0",
|
||||
"micromatch": "^4.0.2",
|
||||
"pirates": "^4.0.1",
|
||||
"realpath-native": "^1.1.0",
|
||||
"slash": "^3.0.0",
|
||||
"source-map": "^0.6.1",
|
||||
"write-file-atomic": "^3.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"devDependencies": {
|
||||
"@types/babel__core": "^7.1.0",
|
||||
"@types/convert-source-map": "^1.5.1",
|
||||
"@types/fast-json-stable-stringify": "^2.0.0",
|
||||
"@types/graceful-fs": "^4.1.2",
|
||||
"@types/micromatch": "^4.0.0",
|
||||
"@types/write-file-atomic": "^3.0.0",
|
||||
"dedent": "^0.7.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.3"
|
||||
},
|
||||
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638",
|
||||
"homepage": "https://github.com/facebook/jest#readme",
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "@jest/transform",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-transform"
|
||||
},
|
||||
"version": "25.1.0"
|
||||
}
|
||||
21
node_modules/@jest/types/LICENSE
generated
vendored
Normal file
21
node_modules/@jest/types/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
||||
172
node_modules/@jest/types/build/Circus.d.ts
generated
vendored
Normal file
172
node_modules/@jest/types/build/Circus.d.ts
generated
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import * as Global from './Global';
|
||||
declare type Process = NodeJS.Process;
|
||||
export declare type DoneFn = Global.DoneFn;
|
||||
export declare type BlockFn = Global.BlockFn;
|
||||
export declare type BlockName = Global.BlockName;
|
||||
export declare type BlockMode = void | 'skip' | 'only' | 'todo';
|
||||
export declare type TestMode = BlockMode;
|
||||
export declare type TestName = Global.TestName;
|
||||
export declare type TestFn = Global.TestFn;
|
||||
export declare type HookFn = (done?: DoneFn) => Promise<any> | null | undefined;
|
||||
export declare type AsyncFn = TestFn | HookFn;
|
||||
export declare type SharedHookType = 'afterAll' | 'beforeAll';
|
||||
export declare type HookType = SharedHookType | 'afterEach' | 'beforeEach';
|
||||
export declare type TestContext = Record<string, any>;
|
||||
export declare type Exception = any;
|
||||
export declare type FormattedError = string;
|
||||
export declare type Hook = {
|
||||
asyncError: Error;
|
||||
fn: HookFn;
|
||||
type: HookType;
|
||||
parent: DescribeBlock;
|
||||
timeout: number | undefined | null;
|
||||
};
|
||||
export declare type EventHandler = (event: Event, state: State) => void;
|
||||
export declare type Event = {
|
||||
name: 'include_test_location_in_result';
|
||||
} | {
|
||||
asyncError: Error;
|
||||
mode: BlockMode;
|
||||
name: 'start_describe_definition';
|
||||
blockName: BlockName;
|
||||
} | {
|
||||
mode: BlockMode;
|
||||
name: 'finish_describe_definition';
|
||||
blockName: BlockName;
|
||||
} | {
|
||||
asyncError: Error;
|
||||
name: 'add_hook';
|
||||
hookType: HookType;
|
||||
fn: HookFn;
|
||||
timeout: number | undefined;
|
||||
} | {
|
||||
asyncError: Error;
|
||||
name: 'add_test';
|
||||
testName: TestName;
|
||||
fn?: TestFn;
|
||||
mode?: TestMode;
|
||||
timeout: number | undefined;
|
||||
} | {
|
||||
name: 'hook_start';
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'hook_success';
|
||||
describeBlock?: DescribeBlock;
|
||||
test?: TestEntry;
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'hook_failure';
|
||||
error: string | Exception;
|
||||
describeBlock?: DescribeBlock;
|
||||
test?: TestEntry;
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'test_fn_start';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_fn_success';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_fn_failure';
|
||||
error: Exception;
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_retry';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_start';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_skip';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_todo';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_done';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'run_describe_start';
|
||||
describeBlock: DescribeBlock;
|
||||
} | {
|
||||
name: 'run_describe_finish';
|
||||
describeBlock: DescribeBlock;
|
||||
} | {
|
||||
name: 'run_start';
|
||||
} | {
|
||||
name: 'run_finish';
|
||||
} | {
|
||||
name: 'error';
|
||||
error: Exception;
|
||||
} | {
|
||||
name: 'setup';
|
||||
testNamePattern?: string;
|
||||
parentProcess: Process;
|
||||
} | {
|
||||
name: 'teardown';
|
||||
};
|
||||
export declare type TestStatus = 'skip' | 'done' | 'todo';
|
||||
export declare type TestResult = {
|
||||
duration?: number | null;
|
||||
errors: Array<FormattedError>;
|
||||
invocations: number;
|
||||
status: TestStatus;
|
||||
location?: {
|
||||
column: number;
|
||||
line: number;
|
||||
} | null;
|
||||
testPath: Array<TestName | BlockName>;
|
||||
};
|
||||
export declare type RunResult = {
|
||||
unhandledErrors: Array<FormattedError>;
|
||||
testResults: TestResults;
|
||||
};
|
||||
export declare type TestResults = Array<TestResult>;
|
||||
export declare type GlobalErrorHandlers = {
|
||||
uncaughtException: Array<(exception: Exception) => void>;
|
||||
unhandledRejection: Array<(exception: Exception, promise: Promise<any>) => void>;
|
||||
};
|
||||
export declare type State = {
|
||||
currentDescribeBlock: DescribeBlock;
|
||||
currentlyRunningTest?: TestEntry | null;
|
||||
expand?: boolean;
|
||||
hasFocusedTests: boolean;
|
||||
originalGlobalErrorHandlers?: GlobalErrorHandlers;
|
||||
parentProcess: Process | null;
|
||||
rootDescribeBlock: DescribeBlock;
|
||||
testNamePattern?: RegExp | null;
|
||||
testTimeout: number;
|
||||
unhandledErrors: Array<Exception>;
|
||||
includeTestLocationInResult: boolean;
|
||||
};
|
||||
export declare type DescribeBlock = {
|
||||
children: Array<DescribeBlock>;
|
||||
hooks: Array<Hook>;
|
||||
mode: BlockMode;
|
||||
name: BlockName;
|
||||
parent?: DescribeBlock;
|
||||
tests: Array<TestEntry>;
|
||||
};
|
||||
export declare type TestError = Exception | Array<[Exception | undefined, Exception]>;
|
||||
export declare type TestEntry = {
|
||||
asyncError: Exception;
|
||||
errors: TestError;
|
||||
fn?: TestFn;
|
||||
invocations: number;
|
||||
mode: TestMode;
|
||||
name: TestName;
|
||||
parent: DescribeBlock;
|
||||
startedAt?: number | null;
|
||||
duration?: number | null;
|
||||
status?: TestStatus | null;
|
||||
timeout?: number;
|
||||
};
|
||||
export {};
|
||||
//# sourceMappingURL=Circus.d.ts.map
|
||||
1
node_modules/@jest/types/build/Circus.d.ts.map
generated
vendored
Normal file
1
node_modules/@jest/types/build/Circus.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Circus.d.ts","sourceRoot":"","sources":["../src/Circus.ts"],"names":[],"mappings":"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"}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user