New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@iobroker/testing

Package Overview
Dependencies
Maintainers
5
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iobroker/testing - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

2

build/tests/unit/harness/loader.d.ts

@@ -9,2 +9,4 @@ /// <reference types="node" />

export declare function monkeyPatchGlobals(code: string, globals: Record<string, Record<string, any>>): string;
/** Removes a hashbang from the code if it exists since that causes compilation errors */
export declare function removeHashbang(code: string): string;
/** A test-safe replacement for process.exit that throws a specific error instead */

@@ -11,0 +13,0 @@ export declare function fakeProcessExit(code?: number): void;

@@ -100,2 +100,7 @@ "use strict";

exports.monkeyPatchGlobals = monkeyPatchGlobals;
/** Removes a hashbang from the code if it exists since that causes compilation errors */
function removeHashbang(code) {
return code.replace(/^#!.+$/m, "");
}
exports.removeHashbang = removeHashbang;
/** A test-safe replacement for process.exit that throws a specific error instead */

@@ -146,2 +151,3 @@ function fakeProcessExit(code = 0) {

module._compile = (code, _filename) => {
code = removeHashbang(code);
code = monkeyPatchGlobals(code, options.globalPatches);

@@ -148,0 +154,0 @@ // Restore everything to not break the NodeJS internals

2

package.json
{
"name": "@iobroker/testing",
"version": "1.1.5",
"version": "1.1.6",
"description": "Shared utilities for adapter and module testing in ioBroker",

@@ -5,0 +5,0 @@ "main": "build/index.js",

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