Add node modules and compiled JavaScript from main

This commit is contained in:
Oliver King 2022-11-02 14:26:33 +00:00
parent 8bccaeaf7c
commit 4181bfdf50
7465 changed files with 1775003 additions and 2 deletions

21
node_modules/jest-watcher/LICENSE generated vendored Normal file
View 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.

22
node_modules/jest-watcher/build/BaseWatchPlugin.d.ts generated vendored Normal file
View file

@ -0,0 +1,22 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/// <reference types="node" />
import type { Config } from '@jest/types';
import type { JestHookSubscriber, UpdateConfigCallback, UsageData, WatchPlugin } from './types';
declare class BaseWatchPlugin implements WatchPlugin {
protected _stdin: NodeJS.ReadStream;
protected _stdout: NodeJS.WriteStream;
constructor({ stdin, stdout, }: {
stdin: NodeJS.ReadStream;
stdout: NodeJS.WriteStream;
});
apply(_hooks: JestHookSubscriber): void;
getUsageInfo(_globalConfig: Config.GlobalConfig): UsageData | null;
onKey(_key: string): void;
run(_globalConfig: Config.GlobalConfig, _updateConfigAndRun: UpdateConfigCallback): Promise<void | boolean>;
}
export default BaseWatchPlugin;

52
node_modules/jest-watcher/build/BaseWatchPlugin.js generated vendored Normal file
View file

@ -0,0 +1,52 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
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.
*/
class BaseWatchPlugin {
constructor({stdin, stdout}) {
_defineProperty(this, '_stdin', void 0);
_defineProperty(this, '_stdout', void 0);
this._stdin = stdin;
this._stdout = stdout;
}
apply(_hooks) {}
getUsageInfo(_globalConfig) {
return null;
}
onKey(_key) {}
run(_globalConfig, _updateConfigAndRun) {
return Promise.resolve();
}
}
var _default = BaseWatchPlugin;
exports.default = _default;

18
node_modules/jest-watcher/build/JestHooks.d.ts generated vendored Normal file
View file

@ -0,0 +1,18 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { JestHookEmitter, JestHookSubscriber } from './types';
declare type AvailableHooks = 'onFileChange' | 'onTestRunComplete' | 'shouldRunTestSuite';
declare class JestHooks {
private _listeners;
private _subscriber;
private _emitter;
constructor();
isUsed(hook: AvailableHooks): boolean;
getSubscriber(): Readonly<JestHookSubscriber>;
getEmitter(): Readonly<JestHookEmitter>;
}
export default JestHooks;

91
node_modules/jest-watcher/build/JestHooks.js generated vendored Normal file
View file

@ -0,0 +1,91 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
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.
*/
class JestHooks {
constructor() {
_defineProperty(this, '_listeners', void 0);
_defineProperty(this, '_subscriber', void 0);
_defineProperty(this, '_emitter', void 0);
this._listeners = {
onFileChange: [],
onTestRunComplete: [],
shouldRunTestSuite: []
};
this._subscriber = {
onFileChange: fn => {
this._listeners.onFileChange.push(fn);
},
onTestRunComplete: fn => {
this._listeners.onTestRunComplete.push(fn);
},
shouldRunTestSuite: fn => {
this._listeners.shouldRunTestSuite.push(fn);
}
};
this._emitter = {
onFileChange: fs =>
this._listeners.onFileChange.forEach(listener => listener(fs)),
onTestRunComplete: results =>
this._listeners.onTestRunComplete.forEach(listener =>
listener(results)
),
shouldRunTestSuite: async testSuiteInfo => {
const result = await Promise.all(
this._listeners.shouldRunTestSuite.map(listener =>
listener(testSuiteInfo)
)
);
return result.every(Boolean);
}
};
}
isUsed(hook) {
var _this$_listeners$hook;
return (
((_this$_listeners$hook = this._listeners[hook]) === null ||
_this$_listeners$hook === void 0
? void 0
: _this$_listeners$hook.length) > 0
);
}
getSubscriber() {
return this._subscriber;
}
getEmitter() {
return this._emitter;
}
}
var _default = JestHooks;
exports.default = _default;

20
node_modules/jest-watcher/build/PatternPrompt.d.ts generated vendored Normal file
View file

@ -0,0 +1,20 @@
/**
* 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 type Prompt from './lib/Prompt';
import type { ScrollOptions } from './types';
export default class PatternPrompt {
protected _pipe: NodeJS.WritableStream;
protected _prompt: Prompt;
protected _entityName: string;
protected _currentUsageRows: number;
constructor(pipe: NodeJS.WritableStream, prompt: Prompt);
run(onSuccess: (value: string) => void, onCancel: () => void, options?: {
header: string;
}): void;
protected _onChange(_pattern: string, _options: ScrollOptions): void;
}

113
node_modules/jest-watcher/build/PatternPrompt.js generated vendored Normal file
View file

@ -0,0 +1,113 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _ansiEscapes() {
const data = _interopRequireDefault(require('ansi-escapes'));
_ansiEscapes = 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;
}
const {CLEAR} = _jestUtil().specialChars;
const usage = entity =>
`\n${_chalk().default.bold('Pattern Mode Usage')}\n` +
` ${_chalk().default.dim('\u203A Press')} Esc ${_chalk().default.dim(
'to exit pattern mode.'
)}\n` +
` ${_chalk().default.dim('\u203A Press')} Enter ` +
`${_chalk().default.dim(`to filter by a ${entity} regex pattern.`)}\n` +
`\n`;
const usageRows = usage('').split('\n').length;
class PatternPrompt {
constructor(pipe, prompt) {
_defineProperty(this, '_pipe', void 0);
_defineProperty(this, '_prompt', void 0);
_defineProperty(this, '_entityName', void 0);
_defineProperty(this, '_currentUsageRows', void 0);
// TODO: Should come in the constructor
this._entityName = '';
this._pipe = pipe;
this._prompt = prompt;
this._currentUsageRows = usageRows;
}
run(onSuccess, onCancel, options) {
this._pipe.write(_ansiEscapes().default.cursorHide);
this._pipe.write(CLEAR);
if (options && options.header) {
this._pipe.write(options.header + '\n');
this._currentUsageRows = usageRows + options.header.split('\n').length;
} else {
this._currentUsageRows = usageRows;
}
this._pipe.write(usage(this._entityName));
this._pipe.write(_ansiEscapes().default.cursorShow);
this._prompt.enter(this._onChange.bind(this), onSuccess, onCancel);
}
_onChange(_pattern, _options) {
this._pipe.write(_ansiEscapes().default.eraseLine);
this._pipe.write(_ansiEscapes().default.cursorLeft);
}
}
exports.default = PatternPrompt;

17
node_modules/jest-watcher/build/constants.d.ts generated vendored Normal file
View file

@ -0,0 +1,17 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export declare const KEYS: {
ARROW_DOWN: string;
ARROW_LEFT: string;
ARROW_RIGHT: string;
ARROW_UP: string;
BACKSPACE: string;
CONTROL_C: string;
CONTROL_D: string;
ENTER: string;
ESCAPE: string;
};

26
node_modules/jest-watcher/build/constants.js generated vendored Normal file
View file

@ -0,0 +1,26 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.KEYS = 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 isWindows = process.platform === 'win32';
const KEYS = {
ARROW_DOWN: '\u001b[B',
ARROW_LEFT: '\u001b[D',
ARROW_RIGHT: '\u001b[C',
ARROW_UP: '\u001b[A',
BACKSPACE: Buffer.from(isWindows ? '08' : '7f', 'hex').toString(),
CONTROL_C: '\u0003',
CONTROL_D: '\u0004',
ENTER: '\r',
ESCAPE: '\u001b'
};
exports.KEYS = KEYS;

13
node_modules/jest-watcher/build/index.d.ts generated vendored Normal file
View 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 as BaseWatchPlugin } from './BaseWatchPlugin';
export { default as JestHook } from './JestHooks';
export { default as PatternPrompt } from './PatternPrompt';
export * from './constants';
export type { AllowedConfigOptions, JestHookEmitter, JestHookSubscriber, ScrollOptions, UpdateConfigCallback, UsageData, WatchPlugin, WatchPluginClass, } from './types';
export { default as Prompt } from './lib/Prompt';
export * from './lib/patternModeHelpers';

75
node_modules/jest-watcher/build/index.js generated vendored Normal file
View file

@ -0,0 +1,75 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _exportNames = {
BaseWatchPlugin: true,
JestHook: true,
PatternPrompt: true,
Prompt: true
};
Object.defineProperty(exports, 'BaseWatchPlugin', {
enumerable: true,
get: function () {
return _BaseWatchPlugin.default;
}
});
Object.defineProperty(exports, 'JestHook', {
enumerable: true,
get: function () {
return _JestHooks.default;
}
});
Object.defineProperty(exports, 'PatternPrompt', {
enumerable: true,
get: function () {
return _PatternPrompt.default;
}
});
Object.defineProperty(exports, 'Prompt', {
enumerable: true,
get: function () {
return _Prompt.default;
}
});
var _BaseWatchPlugin = _interopRequireDefault(require('./BaseWatchPlugin'));
var _JestHooks = _interopRequireDefault(require('./JestHooks'));
var _PatternPrompt = _interopRequireDefault(require('./PatternPrompt'));
var _constants = require('./constants');
Object.keys(_constants).forEach(function (key) {
if (key === 'default' || key === '__esModule') return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _constants[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _constants[key];
}
});
});
var _Prompt = _interopRequireDefault(require('./lib/Prompt'));
var _patternModeHelpers = require('./lib/patternModeHelpers');
Object.keys(_patternModeHelpers).forEach(function (key) {
if (key === 'default' || key === '__esModule') return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _patternModeHelpers[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _patternModeHelpers[key];
}
});
});
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}

25
node_modules/jest-watcher/build/lib/Prompt.d.ts generated vendored Normal file
View file

@ -0,0 +1,25 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { ScrollOptions } from '../types';
export default class Prompt {
private _entering;
private _value;
private _onChange;
private _onSuccess;
private _onCancel;
private _offset;
private _promptLength;
private _selection;
constructor();
private _onResize;
enter(onChange: (pattern: string, options: ScrollOptions) => void, onSuccess: (pattern: string) => void, onCancel: () => void): void;
setPromptLength(length: number): void;
setPromptSelection(selected: string): void;
put(key: string): void;
abort(): void;
isEntering(): boolean;
}

157
node_modules/jest-watcher/build/lib/Prompt.js generated vendored Normal file
View file

@ -0,0 +1,157 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _constants() {
const data = require('../constants');
_constants = 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 Prompt {
constructor() {
_defineProperty(this, '_entering', void 0);
_defineProperty(this, '_value', void 0);
_defineProperty(this, '_onChange', void 0);
_defineProperty(this, '_onSuccess', void 0);
_defineProperty(this, '_onCancel', void 0);
_defineProperty(this, '_offset', void 0);
_defineProperty(this, '_promptLength', void 0);
_defineProperty(this, '_selection', void 0);
_defineProperty(this, '_onResize', () => {
this._onChange();
});
// Copied from `enter` to satisfy TS
this._entering = true;
this._value = '';
this._selection = null;
this._offset = -1;
this._promptLength = 0;
this._onChange = () => {};
this._onSuccess = () => {};
this._onCancel = () => {};
}
enter(onChange, onSuccess, onCancel) {
this._entering = true;
this._value = '';
this._onSuccess = onSuccess;
this._onCancel = onCancel;
this._selection = null;
this._offset = -1;
this._promptLength = 0;
this._onChange = () =>
onChange(this._value, {
max: 10,
offset: this._offset
});
this._onChange();
process.stdout.on('resize', this._onResize);
}
setPromptLength(length) {
this._promptLength = length;
}
setPromptSelection(selected) {
this._selection = selected;
}
put(key) {
switch (key) {
case _constants().KEYS.ENTER:
this._entering = false;
this._onSuccess(this._selection || this._value);
this.abort();
break;
case _constants().KEYS.ESCAPE:
this._entering = false;
this._onCancel(this._value);
this.abort();
break;
case _constants().KEYS.ARROW_DOWN:
this._offset = Math.min(this._offset + 1, this._promptLength - 1);
this._onChange();
break;
case _constants().KEYS.ARROW_UP:
this._offset = Math.max(this._offset - 1, -1);
this._onChange();
break;
case _constants().KEYS.ARROW_LEFT:
case _constants().KEYS.ARROW_RIGHT:
break;
default:
this._value =
key === _constants().KEYS.BACKSPACE
? this._value.slice(0, -1)
: this._value + key;
this._offset = -1;
this._selection = null;
this._onChange();
break;
}
}
abort() {
this._entering = false;
this._value = '';
process.stdout.removeListener('resize', this._onResize);
}
isEntering() {
return this._entering;
}
}
exports.default = Prompt;

8
node_modules/jest-watcher/build/lib/colorize.d.ts generated vendored Normal file
View 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.
*/
declare const _default: (str: string, start: number, end: number) => string;
export default _default;

33
node_modules/jest-watcher/build/lib/colorize.js generated vendored Normal file
View file

@ -0,0 +1,33 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
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.
*/
var _default = (str, start, end) =>
_chalk().default.dim(str.slice(0, start)) +
_chalk().default.reset(str.slice(start, end)) +
_chalk().default.dim(str.slice(end));
exports.default = _default;

View 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.
*/
declare const _default: (testName: string, pattern: string, width: number) => string;
export default _default;

View file

@ -0,0 +1,83 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function () {
return data;
};
return data;
}
var _colorize = _interopRequireDefault(require('./colorize'));
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 DOTS = '...';
const ENTER = '⏎';
var _default = (testName, pattern, width) => {
const inlineTestName = testName.replace(/(\r\n|\n|\r)/gm, ENTER);
let regexp;
try {
regexp = new RegExp(pattern, 'i');
} catch {
return _chalk().default.dim(inlineTestName);
}
const match = inlineTestName.match(regexp);
if (!match) {
return _chalk().default.dim(inlineTestName);
}
const startPatternIndex = Math.max(match.index || 0, 0);
const endPatternIndex = startPatternIndex + match[0].length;
if (inlineTestName.length <= width) {
return (0, _colorize.default)(
inlineTestName,
startPatternIndex,
endPatternIndex
);
}
const slicedTestName = inlineTestName.slice(0, width - DOTS.length);
if (startPatternIndex < slicedTestName.length) {
if (endPatternIndex > slicedTestName.length) {
return (0, _colorize.default)(
slicedTestName + DOTS,
startPatternIndex,
slicedTestName.length + DOTS.length
);
} else {
return (0, _colorize.default)(
slicedTestName + DOTS,
Math.min(startPatternIndex, slicedTestName.length),
endPatternIndex
);
}
}
return `${_chalk().default.dim(slicedTestName)}${_chalk().default.reset(
DOTS
)}`;
};
exports.default = _default;

View 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.
*/
/// <reference types="node" />
export declare const printPatternCaret: (pattern: string, pipe: NodeJS.WritableStream) => void;
export declare const printRestoredPatternCaret: (pattern: string, currentUsageRows: number, pipe: NodeJS.WritableStream) => void;

View file

@ -0,0 +1,68 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.printRestoredPatternCaret = exports.printPatternCaret = void 0;
function _ansiEscapes() {
const data = _interopRequireDefault(require('ansi-escapes'));
_ansiEscapes = function () {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function () {
return data;
};
return data;
}
function _stringLength() {
const data = _interopRequireDefault(require('string-length'));
_stringLength = 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 printPatternCaret = (pattern, pipe) => {
const inputText = `${_chalk().default.dim(' pattern \u203A')} ${pattern}`;
pipe.write(_ansiEscapes().default.eraseDown);
pipe.write(inputText);
pipe.write(_ansiEscapes().default.cursorSavePosition);
};
exports.printPatternCaret = printPatternCaret;
const printRestoredPatternCaret = (pattern, currentUsageRows, pipe) => {
const inputText = `${_chalk().default.dim(' pattern \u203A')} ${pattern}`;
pipe.write(
_ansiEscapes().default.cursorTo(
(0, _stringLength().default)(inputText),
currentUsageRows - 1
)
);
pipe.write(_ansiEscapes().default.cursorRestorePosition);
};
exports.printRestoredPatternCaret = printRestoredPatternCaret;

12
node_modules/jest-watcher/build/lib/scroll.d.ts generated vendored Normal file
View 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 type { ScrollOptions } from '../types';
export default function scroll(size: number, { offset, max }: ScrollOptions): {
end: number;
index: number;
start: number;
};

34
node_modules/jest-watcher/build/lib/scroll.js generated vendored Normal file
View file

@ -0,0 +1,34 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = scroll;
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
function scroll(size, {offset, max}) {
let start = 0;
let index = Math.min(offset, size);
const halfScreen = max / 2;
if (index <= halfScreen) {
start = 0;
} else {
if (size >= max) {
start = Math.min(index - halfScreen - 1, size - max);
}
index = Math.min(index - start, size);
}
return {
end: Math.min(size, start + max),
index,
start
};
}

59
node_modules/jest-watcher/build/types.d.ts generated vendored Normal file
View file

@ -0,0 +1,59 @@
/**
* 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 type { AggregatedResult } from '@jest/test-result';
import type { Config } from '@jest/types';
declare type TestSuiteInfo = {
config: Config.ProjectConfig;
duration?: number;
testPath: string;
};
export declare type JestHookExposedFS = {
projects: Array<{
config: Config.ProjectConfig;
testPaths: Array<Config.Path>;
}>;
};
export declare type FileChange = (fs: JestHookExposedFS) => void;
export declare type ShouldRunTestSuite = (testSuiteInfo: TestSuiteInfo) => Promise<boolean>;
export declare type TestRunComplete = (results: AggregatedResult) => void;
export declare type JestHookSubscriber = {
onFileChange: (fn: FileChange) => void;
onTestRunComplete: (fn: TestRunComplete) => void;
shouldRunTestSuite: (fn: ShouldRunTestSuite) => void;
};
export declare type JestHookEmitter = {
onFileChange: (fs: JestHookExposedFS) => void;
onTestRunComplete: (results: AggregatedResult) => void;
shouldRunTestSuite: (testSuiteInfo: TestSuiteInfo) => Promise<boolean> | boolean;
};
export declare type UsageData = {
key: string;
prompt: string;
};
export declare type AllowedConfigOptions = Partial<Pick<Config.GlobalConfig, 'bail' | 'changedSince' | 'collectCoverage' | 'collectCoverageFrom' | 'collectCoverageOnlyFrom' | 'coverageDirectory' | 'coverageReporters' | 'findRelatedTests' | 'nonFlagArgs' | 'notify' | 'notifyMode' | 'onlyFailures' | 'reporters' | 'testNamePattern' | 'testPathPattern' | 'updateSnapshot' | 'verbose'> & {
mode: 'watch' | 'watchAll';
}>;
export declare type UpdateConfigCallback = (config?: AllowedConfigOptions) => void;
export interface WatchPlugin {
isInternal?: boolean;
apply?: (hooks: JestHookSubscriber) => void;
getUsageInfo?: (globalConfig: Config.GlobalConfig) => UsageData | null;
onKey?: (value: string) => void;
run?: (globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback) => Promise<void | boolean>;
}
export interface WatchPluginClass {
new (options: {
stdin: NodeJS.ReadStream;
stdout: NodeJS.WriteStream;
}): WatchPlugin;
}
export declare type ScrollOptions = {
offset: number;
max: number;
};
export {};

1
node_modules/jest-watcher/build/types.js generated vendored Normal file
View file

@ -0,0 +1 @@
'use strict';

33
node_modules/jest-watcher/package.json generated vendored Normal file
View file

@ -0,0 +1,33 @@
{
"name": "jest-watcher",
"description": "Delightful JavaScript Testing.",
"version": "26.6.2",
"main": "build/index.js",
"types": "build/index.d.ts",
"dependencies": {
"@jest/test-result": "^26.6.2",
"@jest/types": "^26.6.2",
"@types/node": "*",
"ansi-escapes": "^4.2.1",
"chalk": "^4.0.0",
"jest-util": "^26.6.2",
"string-length": "^4.0.1"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/jest",
"directory": "packages/jest-watcher"
},
"bugs": {
"url": "https://github.com/facebook/jest/issues"
},
"engines": {
"node": ">= 10.14.2"
},
"homepage": "https://jestjs.io/",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"gitHead": "4c46930615602cbf983fb7e8e82884c282a624d5"
}