Socket
Socket
Sign inDemoInstall

@vitest/runner

Package Overview
Dependencies
Maintainers
4
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitest/runner - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

66

dist/index.js

@@ -1,2 +0,2 @@

import { getSafeTimers, isObject, createDefer, isNegativeNaN, format, objDisplay, objectAttr, toArray, shuffle } from '@vitest/utils';
import { getSafeTimers, isObject, createDefer, isNegativeNaN, format, objDisplay, objectAttr, toArray, shuffle, assertTypes } from '@vitest/utils';
import { processError } from '@vitest/utils/error';

@@ -227,3 +227,7 @@ export { processError } from '@vitest/utils/error';

function getUsedProps(fn) {
const match = fn.toString().match(/[^(]*\(([^)]*)/);
let fnString = fn.toString();
if (/__async\(this, (?:null|arguments|\[[_0-9, ]*\]), function\*/.test(fnString)) {
fnString = fnString.split("__async(this,")[1];
}
const match = fnString.match(/[^(]*\(([^)]*)/);
if (!match) {

@@ -1021,2 +1025,20 @@ return [];

}
try {
await callTaskHooks(test, test.onFinished || [], "stack");
} catch (e) {
failTask(test.result, e, runner.config.diffOptions);
}
if (test.result.state === "fail") {
try {
await callTaskHooks(
test,
test.onFailed || [],
runner.config.sequence.hooks
);
} catch (e) {
failTask(test.result, e, runner.config.diffOptions);
}
}
delete test.onFailed;
delete test.onFinished;
if (test.result.state === "pass") {

@@ -1032,18 +1054,2 @@ break;

}
try {
await callTaskHooks(test, test.onFinished || [], "stack");
} catch (e) {
failTask(test.result, e, runner.config.diffOptions);
}
if (test.result.state === "fail") {
try {
await callTaskHooks(
test,
test.onFailed || [],
runner.config.sequence.hooks
);
} catch (e) {
failTask(test.result, e, runner.config.diffOptions);
}
}
if (test.fails) {

@@ -1108,9 +1114,14 @@ if (test.result.state === "pass") {

try {
beforeAllCleanups = await callSuiteHook(
suite,
suite,
"beforeAll",
runner,
[suite]
);
try {
beforeAllCleanups = await callSuiteHook(
suite,
suite,
"beforeAll",
runner,
[suite]
);
} catch (e) {
markTasksAsSkipped(suite, runner);
throw e;
}
if (runner.runSuite) {

@@ -1218,2 +1229,3 @@ await runner.runSuite(suite);

function beforeAll(fn, timeout) {
assertTypes(fn, '"beforeAll" callback', ["function"]);
return getCurrentSuite().on(

@@ -1225,2 +1237,3 @@ "beforeAll",

function afterAll(fn, timeout) {
assertTypes(fn, '"afterAll" callback', ["function"]);
return getCurrentSuite().on(

@@ -1232,2 +1245,3 @@ "afterAll",

function beforeEach(fn, timeout) {
assertTypes(fn, '"beforeEach" callback', ["function"]);
return getCurrentSuite().on(

@@ -1239,2 +1253,3 @@ "beforeEach",

function afterEach(fn, timeout) {
assertTypes(fn, '"afterEach" callback', ["function"]);
return getCurrentSuite().on(

@@ -1265,2 +1280,3 @@ "afterEach",

return (fn, timeout) => {
assertTypes(fn, `"${name}" callback`, ["function"]);
const current = getCurrentTest();

@@ -1267,0 +1283,0 @@ if (!current) {

{
"name": "@vitest/runner",
"type": "module",
"version": "2.1.1",
"version": "2.1.2",
"description": "Vitest test runner",

@@ -42,3 +42,3 @@ "license": "MIT",

"pathe": "^1.1.2",
"@vitest/utils": "2.1.1"
"@vitest/utils": "2.1.2"
},

@@ -45,0 +45,0 @@ "scripts": {

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