1
0
mirror of https://github.com/actions/labeler synced 2026-05-09 17:01:02 +02:00
This commit is contained in:
David Kale
2020-09-08 13:25:36 -04:00
parent e4246d2b5b
commit 91fcbb0108
4227 changed files with 416837 additions and 457884 deletions

23
node_modules/jest-circus/LICENSE generated vendored
View File

@@ -1,23 +0,0 @@
MIT License
For Jest software
Copyright (c) 2014-present, Facebook, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1 +1 @@
{"version":3,"file":"eventHandler.d.ts","sourceRoot":"","sources":["../src/eventHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAgBnC,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,YAkL1B,CAAC;AAEF,eAAe,YAAY,CAAC"}
{"version":3,"file":"eventHandler.d.ts","sourceRoot":"","sources":["../src/eventHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAgBnC,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,YAgL1B,CAAC;AAEF,eAAe,YAAY,CAAC"}

View File

@@ -49,9 +49,7 @@ const eventHandler = (event, state) => {
if (!(0, _utils.describeBlockHasTests)(currentDescribeBlock)) {
currentDescribeBlock.hooks.forEach(hook => {
hook.asyncError.message = `Invalid: ${
hook.type
}() may not be used in a describe block containing no tests.`;
hook.asyncError.message = `Invalid: ${hook.type}() may not be used in a describe block containing no tests.`;
state.unhandledErrors.push(hook.asyncError);
});
} // inherit mode from its parent describe but

View File

@@ -1 +1 @@
{"version":3,"file":"formatNodeAssertErrors.d.ts","sourceRoot":"","sources":["../src/formatNodeAssertErrors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAgCnC,QAAA,MAAM,sBAAsB,oDA4B3B,CAAC;AAsGF,eAAe,sBAAsB,CAAC"}
{"version":3,"file":"formatNodeAssertErrors.d.ts","sourceRoot":"","sources":["../src/formatNodeAssertErrors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAgCnC,QAAA,MAAM,sBAAsB,oDA4B3B,CAAC;AAsHF,eAAe,sBAAsB,CAAC"}

View File

@@ -5,6 +5,8 @@ Object.defineProperty(exports, '__esModule', {
});
exports.default = void 0;
var _assert = require('assert');
var _jestMatcherUtils = require('jest-matcher-utils');
var _chalk = _interopRequireDefault(require('chalk'));
@@ -102,7 +104,7 @@ const formatNodeAssertErrors = (event, state) => {
error = errors;
}
return error.code === 'ERR_ASSERTION'
return isAssertionError(error)
? {
message: assertionErrorMessage(error, {
expand: state.expand
@@ -139,27 +141,30 @@ const operatorMessage = operator => {
};
const assertThrowingMatcherHint = operatorName =>
_chalk.default.dim('assert') +
_chalk.default.dim('.' + operatorName + '(') +
_chalk.default.red('function') +
_chalk.default.dim(')');
operatorName
? _chalk.default.dim('assert') +
_chalk.default.dim('.' + operatorName + '(') +
_chalk.default.red('function') +
_chalk.default.dim(')')
: '';
const assertMatcherHint = (operator, operatorName) => {
let message =
_chalk.default.dim('assert') +
_chalk.default.dim('.' + operatorName + '(') +
_chalk.default.red('received') +
_chalk.default.dim(', ') +
_chalk.default.green('expected') +
_chalk.default.dim(')');
const assertMatcherHint = (operator, operatorName, expected) => {
let message = '';
if (operator === '==') {
message +=
' or ' +
if (operator === '==' && expected === true) {
message =
_chalk.default.dim('assert') +
_chalk.default.dim('(') +
_chalk.default.red('received') +
_chalk.default.dim(') ');
_chalk.default.dim(')');
} else if (operatorName) {
message =
_chalk.default.dim('assert') +
_chalk.default.dim('.' + operatorName + '(') +
_chalk.default.red('received') +
_chalk.default.dim(', ') +
_chalk.default.green('expected') +
_chalk.default.dim(')');
}
return message;
@@ -181,8 +186,7 @@ function assertionErrorMessage(error, options) {
if (operatorName === 'doesNotThrow') {
return (
assertThrowingMatcherHint(operatorName) +
'\n\n' +
buildHintString(assertThrowingMatcherHint(operatorName)) +
_chalk.default.reset(`Expected the function not to throw an error.\n`) +
_chalk.default.reset(`Instead, it threw:\n`) +
` ${(0, _jestMatcherUtils.printReceived)(actual)}` +
@@ -195,8 +199,7 @@ function assertionErrorMessage(error, options) {
if (operatorName === 'throws') {
return (
assertThrowingMatcherHint(operatorName) +
'\n\n' +
buildHintString(assertThrowingMatcherHint(operatorName)) +
_chalk.default.reset(`Expected the function to throw an error.\n`) +
_chalk.default.reset(`But it didn't throw anything.`) +
_chalk.default.reset(
@@ -207,8 +210,7 @@ function assertionErrorMessage(error, options) {
}
return (
assertMatcherHint(operator, operatorName) +
'\n\n' +
buildHintString(assertMatcherHint(operator, operatorName, expected)) +
_chalk.default.reset(`Expected value ${operatorMessage(operator)}`) +
` ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
_chalk.default.reset(`Received:\n`) +
@@ -219,5 +221,18 @@ function assertionErrorMessage(error, options) {
);
}
function isAssertionError(error) {
return (
error &&
(error instanceof _assert.AssertionError ||
error.name === _assert.AssertionError.name ||
error.code === 'ERR_ASSERTION')
);
}
function buildHintString(hint) {
return hint ? hint + '\n\n' : '';
}
var _default = formatNodeAssertErrors;
exports.default = _default;

View File

@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
/// <reference types="node" />
import { Circus, Config } from '@jest/types';
import { Circus, Config, Global } from '@jest/types';
import { JestEnvironment } from '@jest/environment';
import { TestResult } from '@jest/test-result';
export declare const initialize: ({ config, environment, getPrettier, getBabelTraverse, globalConfig, localRequire, parentProcess, testPath, }: {
@@ -24,21 +24,21 @@ export declare const initialize: ({ config, environment, getPrettier, getBabelTr
beforeAll: (fn: Circus.HookFn, timeout?: number | undefined) => void;
beforeEach: (fn: Circus.HookFn, timeout?: number | undefined) => void;
describe: {
(blockName: string, blockFn: import("@jest/types/build/Global").BlockFn): void;
each: (table: import("@jest/types/build/Global").EachTable, ...taggedTemplateData: unknown[]) => (title: string, test: import("@jest/types/build/Global").EachTestFn, timeout?: number | undefined) => void;
(blockName: string, blockFn: Global.BlockFn): void;
each: (table: Global.EachTable, ...taggedTemplateData: unknown[]) => (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void;
only: {
(blockName: string, blockFn: import("@jest/types/build/Global").BlockFn): void;
each: (table: import("@jest/types/build/Global").EachTable, ...taggedTemplateData: unknown[]) => (title: string, test: import("@jest/types/build/Global").EachTestFn, timeout?: number | undefined) => void;
(blockName: string, blockFn: Global.BlockFn): void;
each: (table: Global.EachTable, ...taggedTemplateData: unknown[]) => (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void;
};
skip: {
(blockName: string, blockFn: import("@jest/types/build/Global").BlockFn): void;
each: (table: import("@jest/types/build/Global").EachTable, ...taggedTemplateData: unknown[]) => (title: string, test: import("@jest/types/build/Global").EachTestFn, timeout?: number | undefined) => void;
(blockName: string, blockFn: Global.BlockFn): void;
each: (table: Global.EachTable, ...taggedTemplateData: unknown[]) => (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void;
};
};
it: import("@jest/types/build/Global").It;
test: import("@jest/types/build/Global").It;
it: Global.It;
test: Global.It;
};
snapshotState: import("../../../jest-snapshot/build/State").default;
snapshotState: import("jest-snapshot/build/State").default;
};
export declare const runAndTransformResultsToJestFormat: ({ config, globalConfig, testPath, }: {
config: Config.ProjectConfig;

View File

@@ -1 +1 @@
{"version":3,"file":"jestAdapterInit.d.ts","sourceRoot":"","sources":["../../src/legacy-code-todo-rewrite/jestAdapterInit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,MAAM,EAAE,MAAM,EAAC,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAA0B,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAgBtE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoGtB,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;yBA0G9C,CAAC"}
{"version":3,"file":"jestAdapterInit.d.ts","sourceRoot":"","sources":["../../src/legacy-code-todo-rewrite/jestAdapterInit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAC,MAAM,aAAa,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAA0B,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAsBtE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2GtB,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;yBA0G9C,CAAC"}

View File

@@ -71,15 +71,20 @@ const initialize = ({
parentProcess,
testPath
}) => {
const mutex = (0, _throat.default)(globalConfig.maxConcurrency);
Object.assign(global, _.default);
global.xit = global.it.skip;
global.xtest = global.it.skip;
global.xdescribe = global.describe.skip;
global.fit = global.it.only;
global.fdescribe = global.describe.only;
if (globalConfig.testTimeout) {
(0, _state.getState)().testTimeout = globalConfig.testTimeout;
}
global.test.concurrent = (test => {
const mutex = (0, _throat.default)(globalConfig.maxConcurrency);
const nodeGlobal = global;
Object.assign(nodeGlobal, _.default);
nodeGlobal.xit = nodeGlobal.it.skip;
nodeGlobal.xtest = nodeGlobal.it.skip;
nodeGlobal.xdescribe = nodeGlobal.describe.skip;
nodeGlobal.fit = nodeGlobal.it.only;
nodeGlobal.fdescribe = nodeGlobal.describe.only;
nodeGlobal.test.concurrent = (test => {
const concurrent = (testName, testFn, timeout) => {
// For concurrent tests we first run the function that returns promise, and then register a
// nomral test that will be waiting on the returned promise (when we start the test, the promise
@@ -88,7 +93,7 @@ const initialize = ({
// that will result in this test to be skipped, so we'll be executing the promise function anyway,
// even if it ends up being skipped.
const promise = mutex(() => testFn());
global.test(testName, () => promise, timeout);
nodeGlobal.test(testName, () => promise, timeout);
};
concurrent.only = (testName, testFn, timeout) => {
@@ -99,7 +104,7 @@ const initialize = ({
concurrent.skip = test.skip;
return concurrent;
})(global.test);
})(nodeGlobal.test);
(0, _state.addEventHandler)(eventHandler);
@@ -139,7 +144,8 @@ const initialize = ({
(0, _expect.setState)({
snapshotState,
testPath
}); // Return it back to the outer scope (test runner outside the VM).
});
(0, _state.addEventHandler)(handleSnapshotStateAfterRetry(snapshotState)); // Return it back to the outer scope (test runner outside the VM).
return {
globals: _.default,
@@ -259,6 +265,15 @@ const runAndTransformResultsToJestFormat =
exports.runAndTransformResultsToJestFormat = runAndTransformResultsToJestFormat;
const handleSnapshotStateAfterRetry = snapshotState => event => {
switch (event.name) {
case 'test_retry': {
// Clear any snapshot data that occurred in previous test run
snapshotState.clear();
}
}
};
const eventHandler = event => {
switch (event.name) {
case 'test_start': {

View File

@@ -1,54 +1,50 @@
{
"_args": [
[
"jest-circus@24.8.0",
"/Users/pjquirk/Source/GitHub/actions/labeler"
]
],
"_development": true,
"_from": "jest-circus@24.8.0",
"_id": "jest-circus@24.8.0",
"_from": "jest-circus@^24.7.1",
"_id": "jest-circus@24.9.0",
"_inBundle": false,
"_integrity": "sha512-2QASG3QuDdk0SMP2O73D8u3/lc/A/E2G7q23v5WhbUR+hCGzWZXwRMKif18f11dSLfL1wcrMbwE4IorvV0DRVw==",
"_integrity": "sha512-dwkvwFtRc9Anmk1XTc+bonVL8rVMZ3CeGMoFWmv1oaQThdAgvfI9bwaFlZp+gLVphNVz6ZLfCWo3ERhS5CeVvA==",
"_location": "/jest-circus",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "jest-circus@24.8.0",
"raw": "jest-circus@^24.7.1",
"name": "jest-circus",
"escapedName": "jest-circus",
"rawSpec": "24.8.0",
"rawSpec": "^24.7.1",
"saveSpec": null,
"fetchSpec": "24.8.0"
"fetchSpec": "^24.7.1"
},
"_requiredBy": [
"#DEV:/"
],
"_resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-24.8.0.tgz",
"_spec": "24.8.0",
"_where": "/Users/pjquirk/Source/GitHub/actions/labeler",
"_resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-24.9.0.tgz",
"_shasum": "8a557683636807d537507eac02ba64c95b686485",
"_spec": "jest-circus@^24.7.1",
"_where": "/Users/dakale/dev/GitHub/actions/labeler",
"bugs": {
"url": "https://github.com/facebook/jest/issues"
},
"bundleDependencies": false,
"dependencies": {
"@babel/traverse": "^7.1.0",
"@jest/environment": "^24.8.0",
"@jest/test-result": "^24.8.0",
"@jest/types": "^24.8.0",
"@jest/environment": "^24.9.0",
"@jest/test-result": "^24.9.0",
"@jest/types": "^24.9.0",
"chalk": "^2.0.1",
"co": "^4.6.0",
"expect": "^24.8.0",
"expect": "^24.9.0",
"is-generator-fn": "^2.0.0",
"jest-each": "^24.8.0",
"jest-matcher-utils": "^24.8.0",
"jest-message-util": "^24.8.0",
"jest-snapshot": "^24.8.0",
"jest-util": "^24.8.0",
"pretty-format": "^24.8.0",
"jest-each": "^24.9.0",
"jest-matcher-utils": "^24.9.0",
"jest-message-util": "^24.9.0",
"jest-snapshot": "^24.9.0",
"jest-util": "^24.9.0",
"pretty-format": "^24.9.0",
"stack-utils": "^1.0.1",
"throat": "^4.0.0"
},
"deprecated": false,
"description": "<h1 align=\"center\"> <img src=\"https://jestjs.io/img/jest.png\" height=\"150\" width=\"150\"/> <img src=\"https://jestjs.io/img/circus.png\" height=\"150\" width=\"150\"/> <p align=\"center\">jest-circus</p> <p align=\"center\">The next-gen test runner for Jest</p> </h1>",
"devDependencies": {
"@jest/test-utils": "^24.4.0",
@@ -56,12 +52,12 @@
"@types/co": "^4.6.0",
"@types/stack-utils": "^1.0.1",
"execa": "^1.0.0",
"jest-runtime": "^24.8.0"
"jest-runtime": "^24.9.0"
},
"engines": {
"node": ">= 6"
},
"gitHead": "845728f24b3ef41e450595c384e9b5c9fdf248a4",
"gitHead": "9ad0f4bc6b8bdd94989804226c28c9960d9da7d1",
"homepage": "https://github.com/facebook/jest#readme",
"license": "MIT",
"main": "build/index.js",
@@ -75,5 +71,5 @@
"directory": "packages/jest-circus"
},
"types": "build/index.d.ts",
"version": "24.8.0"
"version": "24.9.0"
}

5
node_modules/jest-circus/runner.js generated vendored
View File

@@ -1,9 +1,8 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// Allow people to use `jest-circus/runner` as a runner.

View File

@@ -1,20 +0,0 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "build",
"rootDir": "src"
},
"references": [
{"path": "../jest-each"},
{"path": "../jest-environment"},
{"path": "../jest-matcher-utils"},
{"path": "../jest-message-util"},
{"path": "../jest-runtime"},
{"path": "../jest-snapshot"},
{"path": "../jest-test-result"},
{"path": "../jest-types"},
{"path": "../jest-util"},
{"path": "../pretty-format"},
{"path": "../test-utils"}
]
}

File diff suppressed because it is too large Load Diff