Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wdio/utils

Package Overview
Dependencies
Maintainers
7
Versions
298
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wdio/utils - npm Package Compare versions

Comparing version 5.16.12 to 5.16.13

43

build/shim.js

@@ -13,2 +13,3 @@ "use strict";

const log = (0, _logger.default)('@wdio/utils:shim');
let inCommandHook = false;
let hasWdioSyncSupport = false;

@@ -60,20 +61,34 @@ exports.hasWdioSyncSupport = hasWdioSyncSupport;

let wrapCommand = async function (commandName, fn, ...args) {
await executeHooksWithArgs.call(this, this.options.beforeCommand, [commandName, args]);
let commandResult;
let commandError;
let wrapCommand = function wrapCommand(commandName, fn) {
return async function wrapCommandFn(...args) {
const beforeHookArgs = [commandName, args];
try {
commandResult = await fn.apply(this, args);
} catch (err) {
commandError = err;
}
if (!inCommandHook) {
inCommandHook = true;
await executeHooksWithArgs.call(this, this.options.beforeCommand, beforeHookArgs);
inCommandHook = false;
}
await executeHooksWithArgs.call(this, this.options.afterCommand, [commandName, args, commandResult, commandError]);
let commandResult;
let commandError;
if (commandError) {
throw commandError;
}
try {
commandResult = await fn.apply(this, args);
} catch (err) {
commandError = err;
}
return commandResult;
if (!inCommandHook) {
inCommandHook = true;
const afterHookArgs = [...beforeHookArgs, commandResult, commandError];
await executeHooksWithArgs.call(this, this.options.afterCommand, afterHookArgs);
inCommandHook = false;
}
if (commandError) {
throw commandError;
}
return commandResult;
};
};

@@ -80,0 +95,0 @@

{
"name": "@wdio/utils",
"version": "5.16.12",
"version": "5.16.13",
"description": "A WDIO helper utility to provide several utility functions used across the project.",

@@ -40,3 +40,3 @@ "author": "Christian Bromann <christian@saucelabs.com>",

},
"gitHead": "6bb593e8170fd9f7032fd0d1767147ce167d4c89"
"gitHead": "d25c41d08c46c58a22282133d501990b652f34b7"
}
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