Socket
Socket
Sign inDemoInstall

create-jest-runner

Package Overview
Dependencies
Maintainers
8
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-jest-runner - npm Package Compare versions

Comparing version 0.10.0 to 0.11.0

5

build/createJestRunner.d.ts

@@ -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;

16

build/createJestRunner.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc