create-jest-runner
Advanced tools
Comparing version 0.10.0 to 0.11.0
@@ -1,2 +0,3 @@ | ||
import type { CreateRunnerOptions, Path, TestRunner } from './types'; | ||
export default function createRunner<ExtraOptionsType extends Record<string, unknown>>(runPath: Path, { getExtraOptions }?: CreateRunnerOptions<ExtraOptionsType>): typeof TestRunner; | ||
import { CallbackTestRunner } from 'jest-runner'; | ||
import type { CreateRunnerOptions, Path } from './types'; | ||
export default function createRunner<ExtraOptionsType extends Record<string, unknown>>(runPath: Path, { getExtraOptions }?: CreateRunnerOptions<ExtraOptionsType>): typeof CallbackTestRunner; |
@@ -8,2 +8,4 @@ "use strict"; | ||
var _jestRunner = require("jest-runner"); | ||
var _jestWorker = require("jest-worker"); | ||
@@ -39,8 +41,3 @@ | ||
} = {}) { | ||
return class BaseTestRunner { | ||
constructor(_globalConfig, _context = {}) { | ||
this._globalConfig = _globalConfig; | ||
this._context = _context; | ||
} | ||
return class BaseTestRunner extends _jestRunner.CallbackTestRunner { | ||
runTests(tests, watcher, onStart, onResult, onFailure, options) { | ||
@@ -95,3 +92,3 @@ return options.serial ? this._createInBandTestRun(tests, watcher, onStart, onResult, onFailure, options) : this._createParallelTestRun(tests, watcher, onStart, onResult, onFailure, options); | ||
return onStart(test).then(() => { | ||
const baseOptions = { | ||
const runTestOptions = { | ||
config: test.context.config, | ||
@@ -103,5 +100,4 @@ globalConfig: this._globalConfig, | ||
extraOptions: getExtraOptions ? getExtraOptions() : {} | ||
}; // @ts-expect-error -- the required module should have a default export | ||
return worker.default(baseOptions); | ||
}; | ||
return worker.default(runTestOptions); | ||
}); | ||
@@ -108,0 +104,0 @@ }); |
@@ -20,3 +20,3 @@ "use strict"; | ||
// Both methods are currently in used by downstream packages. | ||
// The current behaviour is to favour `errorMessage` over `test.errorMessage`. | ||
// The current behavior is to favour `errorMessage` over `test.errorMessage`. | ||
const actualErrorMessage = errorMessage || test.errorMessage; | ||
@@ -23,0 +23,0 @@ return (0, _toTestResult.default)({ |
@@ -1,5 +0,4 @@ | ||
import type { Config as JestConfig, TestResult as JestTestResult } from '@jest/types'; | ||
import type * as JestRunner from 'jest-runner'; | ||
import type { TestResult as JestTestResult } from '@jest/types'; | ||
export declare type Milliseconds = JestTestResult.Milliseconds; | ||
export declare type Path = JestConfig.Path; | ||
export declare type Path = string; | ||
export interface TestDetail { | ||
@@ -12,7 +11,1 @@ title: string; | ||
} | ||
export declare abstract class TestRunner { | ||
readonly _globalConfig: JestConfig.GlobalConfig; | ||
readonly _context: JestRunner.TestRunnerContext; | ||
constructor(globalConfig: JestConfig.GlobalConfig, context?: JestRunner.TestRunnerContext); | ||
runTests(tests: Array<JestRunner.Test>, watcher: JestRunner.TestWatcher, onStart: JestRunner.OnTestStart, onResult: JestRunner.OnTestSuccess, onFailure: JestRunner.OnTestFailure, options: JestRunner.TestRunnerOptions): Promise<void>; | ||
} |
{ | ||
"name": "create-jest-runner", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"main": "build/index.js", | ||
@@ -34,3 +34,3 @@ "types": "build/index.d.ts", | ||
"chalk": "^4.1.0", | ||
"jest-worker": "^27.0.6", | ||
"jest-worker": "^28.0.2", | ||
"throat": "^6.0.1" | ||
@@ -43,8 +43,8 @@ }, | ||
"@babel/preset-typescript": "^7.0.0", | ||
"@jest/test-result": "^27.0.6", | ||
"@jest/types": "^27.0.6", | ||
"@jest/test-result": "^28.0.2", | ||
"@tsconfig/node12": "^1.0.9", | ||
"@types/node": "^16.11.4", | ||
"@typescript-eslint/eslint-plugin": "^5.14.0", | ||
"@typescript-eslint/parser": "^5.14.0", | ||
"babel-jest": "^27.0.6", | ||
"babel-jest": "^28.0.3", | ||
"eslint": "^8.10.0", | ||
@@ -57,4 +57,4 @@ "eslint-config-airbnb-base": "^15.0.0", | ||
"execa": "^5.0.0", | ||
"jest": "^27.0.6", | ||
"jest-runner": "^27.0.6", | ||
"jest": "^28.0.3", | ||
"jest-runner": "^28.0.3", | ||
"prettier": "^2.0.5", | ||
@@ -65,5 +65,4 @@ "strip-ansi": "^6.0.0", | ||
"peerDependencies": { | ||
"@jest/test-result": "^27.0.0", | ||
"@jest/types": "^27.0.0", | ||
"jest-runner": "^27.0.0" | ||
"@jest/test-result": "^28.0.0", | ||
"jest-runner": "^28.0.0" | ||
}, | ||
@@ -74,5 +73,2 @@ "peerDependenciesMeta": { | ||
}, | ||
"@jest/types": { | ||
"optional": true | ||
}, | ||
"jest-runner": { | ||
@@ -79,0 +75,0 @@ "optional": true |
@@ -74,3 +74,4 @@ # create-jest-runner | ||
module.exports = ({ testPath }) => { | ||
/** @type {import('create-jest-runner').RunTest} */ | ||
const runTest = ({ testPath }) => { | ||
const start = Date.now(); | ||
@@ -90,2 +91,4 @@ const contents = fs.readFileSync(testPath, 'utf8'); | ||
}; | ||
module.exports = runTest; | ||
``` | ||
@@ -102,4 +105,3 @@ | ||
**Note:** You will have to update the package name in `package.json` of the | ||
generated runner | ||
**Note:** You will have to update the package name in `package.json` of the generated runner. | ||
@@ -106,0 +108,0 @@ ## Add your runner to Jest config |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
132
22432
500
+ Added@jest/console@28.1.3(transitive)
+ Added@jest/environment@28.1.3(transitive)
+ Added@jest/expect@28.1.3(transitive)
+ Added@jest/expect-utils@28.1.3(transitive)
+ Added@jest/fake-timers@28.1.3(transitive)
+ Added@jest/globals@28.1.3(transitive)
+ Added@jest/schemas@28.1.3(transitive)
+ Added@jest/source-map@28.1.2(transitive)
+ Added@jest/test-result@28.1.3(transitive)
+ Added@jest/transform@28.1.3(transitive)
+ Added@jest/types@28.1.3(transitive)
+ Added@sinclair/typebox@0.24.51(transitive)
+ Added@sinonjs/fake-timers@9.1.2(transitive)
+ Added@types/yargs@17.0.33(transitive)
+ Addedansi-escapes@4.3.2(transitive)
+ Addedcaniuse-lite@1.0.30001662(transitive)
+ Addedchar-regex@1.0.2(transitive)
+ Addeddiff-sequences@28.1.1(transitive)
+ Addedelectron-to-chromium@1.5.27(transitive)
+ Addedemittery@0.10.2(transitive)
+ Addedexpect@28.1.3(transitive)
+ Addedjest-diff@28.1.3(transitive)
+ Addedjest-docblock@28.1.1(transitive)
+ Addedjest-environment-node@28.1.3(transitive)
+ Addedjest-get-type@28.0.2(transitive)
+ Addedjest-haste-map@28.1.3(transitive)
+ Addedjest-leak-detector@28.1.3(transitive)
+ Addedjest-matcher-utils@28.1.3(transitive)
+ Addedjest-message-util@28.1.3(transitive)
+ Addedjest-mock@28.1.3(transitive)
+ Addedjest-regex-util@28.0.2(transitive)
+ Addedjest-resolve@28.1.3(transitive)
+ Addedjest-runner@28.1.3(transitive)
+ Addedjest-runtime@28.1.3(transitive)
+ Addedjest-snapshot@28.1.3(transitive)
+ Addedjest-util@28.1.3(transitive)
+ Addedjest-validate@28.1.3(transitive)
+ Addedjest-watcher@28.1.3(transitive)
+ Addedjest-worker@28.1.3(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedpretty-format@28.1.3(transitive)
+ Addedreact-is@18.3.1(transitive)
+ Addedsource-map-support@0.5.13(transitive)
+ Addedstring-length@4.0.2(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedtype-fest@0.21.3(transitive)
+ Addedwrite-file-atomic@4.0.2(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removed@jest/console@27.5.1(transitive)
- Removed@jest/environment@27.5.1(transitive)
- Removed@jest/fake-timers@27.5.1(transitive)
- Removed@jest/globals@27.5.1(transitive)
- Removed@jest/source-map@27.5.1(transitive)
- Removed@jest/test-result@27.5.1(transitive)
- Removed@jest/transform@27.5.1(transitive)
- Removed@jest/types@27.5.1(transitive)
- Removed@sinonjs/fake-timers@8.1.0(transitive)
- Removed@tootallnate/once@1.1.2(transitive)
- Removed@types/yargs@16.0.9(transitive)
- Removedabab@2.0.6(transitive)
- Removedacorn@7.4.18.12.1(transitive)
- Removedacorn-globals@6.0.0(transitive)
- Removedacorn-walk@7.2.0(transitive)
- Removedagent-base@6.0.2(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedbrowser-process-hrtime@1.0.0(transitive)
- Removedcaniuse-lite@1.0.30001660(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcssom@0.3.80.4.4(transitive)
- Removedcssstyle@2.3.0(transitive)
- Removeddata-urls@2.0.0(transitive)
- Removeddecimal.js@10.4.3(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddiff-sequences@27.5.1(transitive)
- Removeddomexception@2.0.1(transitive)
- Removedelectron-to-chromium@1.5.23(transitive)
- Removedemittery@0.8.1(transitive)
- Removedescodegen@2.1.0(transitive)
- Removedestraverse@5.3.0(transitive)
- Removedesutils@2.0.3(transitive)
- Removedexpect@27.5.1(transitive)
- Removedform-data@3.0.1(transitive)
- Removedhtml-encoding-sniffer@2.0.1(transitive)
- Removedhttp-proxy-agent@4.0.1(transitive)
- Removedhttps-proxy-agent@5.0.1(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedis-potential-custom-element-name@1.0.1(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedjest-diff@27.5.1(transitive)
- Removedjest-docblock@27.5.1(transitive)
- Removedjest-environment-jsdom@27.5.1(transitive)
- Removedjest-environment-node@27.5.1(transitive)
- Removedjest-get-type@27.5.1(transitive)
- Removedjest-haste-map@27.5.1(transitive)
- Removedjest-leak-detector@27.5.1(transitive)
- Removedjest-matcher-utils@27.5.1(transitive)
- Removedjest-message-util@27.5.1(transitive)
- Removedjest-mock@27.5.1(transitive)
- Removedjest-regex-util@27.5.1(transitive)
- Removedjest-resolve@27.5.1(transitive)
- Removedjest-runner@27.5.1(transitive)
- Removedjest-runtime@27.5.1(transitive)
- Removedjest-serializer@27.5.1(transitive)
- Removedjest-snapshot@27.5.1(transitive)
- Removedjest-util@27.5.1(transitive)
- Removedjest-validate@27.5.1(transitive)
- Removedjest-worker@27.5.1(transitive)
- Removedjsdom@16.7.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removednwsapi@2.2.12(transitive)
- Removedparse5@6.0.1(transitive)
- Removedpretty-format@27.5.1(transitive)
- Removedpsl@1.9.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedquerystringify@2.2.0(transitive)
- Removedreact-is@17.0.2(transitive)
- Removedrequires-port@1.0.0(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsaxes@5.0.1(transitive)
- Removedsource-map-support@0.5.21(transitive)
- Removedsymbol-tree@3.2.4(transitive)
- Removedtough-cookie@4.1.4(transitive)
- Removedtr46@2.1.0(transitive)
- Removedtypedarray-to-buffer@3.1.5(transitive)
- Removeduniversalify@0.2.0(transitive)
- Removedurl-parse@1.5.10(transitive)
- Removedw3c-hr-time@1.0.2(transitive)
- Removedw3c-xmlserializer@2.0.0(transitive)
- Removedwebidl-conversions@5.0.06.1.0(transitive)
- Removedwhatwg-encoding@1.0.5(transitive)
- Removedwhatwg-mimetype@2.3.0(transitive)
- Removedwhatwg-url@8.7.0(transitive)
- Removedwrite-file-atomic@3.0.3(transitive)
- Removedws@7.5.10(transitive)
- Removedxml-name-validator@3.0.0(transitive)
- Removedxmlchars@2.2.0(transitive)
Updatedjest-worker@^28.0.2