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

testdouble

Package Overview
Dependencies
Maintainers
4
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testdouble - npm Package Compare versions

Comparing version 3.18.0 to 3.19.0

lib/can-register-loader.js

3

lib/replace/index.js

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

const property_1 = require("./property");
const can_register_loader_1 = require("../can-register-loader");
quibble.ignoreCallsFromThisFile();

@@ -20,3 +21,3 @@ function default_1(target) {

function replaceEsm(_modulePath, _namedExportReplacement, _defaultExportReplacement) {
if (!quibble.isLoaderLoaded()) {
if (!(0, can_register_loader_1.canRegisterLoader)() && !quibble.isLoaderLoaded()) {
throw new Error('testdouble ESM loader not loaded. You cannot replace ES modules without a loader. Run node with `--loader=testdouble`.');

@@ -23,0 +24,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = '3.18.0';
exports.default = '3.19.0';
{
"name": "testdouble",
"version": "3.18.0",
"version": "3.19.0",
"description": "A minimal test double library for TDD with JavaScript",

@@ -18,3 +18,3 @@ "homepage": "https://github.com/testdouble/testdouble.js",

},
"./": "./"
"./package.json": "./package.json"
},

@@ -49,5 +49,7 @@ "files": [

"test:esm": "cross-env NODE_OPTIONS=\"--loader=quibble\" TS_NODE_IGNORE=\"node_modules,notypescript\" ./test/safe-esm/teenytest-proxy.js --helper test/helper.js test/safe-esm/replace.test.js",
"test:no-loader-esm": "cross-env TS_NODE_IGNORE=\"node_modules,notypescript\" teenytest test/helper.js './test/safe-esm/*.no-loader-test.{mjs,js}'",
"test:esm-auto-loader": "node test/esm-lib/supports-auto-load.js not || TS_NODE_IGNORE=\"node_modules,notypescript\" ./test/safe-esm/teenytest-proxy.js --helper test/helper.js test/safe-esm/replace.test.js",
"test:no-loader-esm": "node test/esm-lib/supports-auto-load.js || cross-env TS_NODE_IGNORE=\"node_modules,notypescript\" teenytest test/helper.js './test/safe-esm/*.no-loader-test.{mjs,js}'",
"test:ci": "npm run compile && run-p style test && echo \"All done!\"",
"test:example": "run-s test:example:babel test:example:jest test:example:jest-broken test:example:node test:example:node-ava test:example:node-esm",
"test:example-esm-auto-loader": "node test/esm-lib/supports-auto-load.js not || npm run test:example:node-esm-auto-loader",
"test:example:babel": "bash ./script/run-examples babel",

@@ -60,2 +62,3 @@ "test:example:jest": "bash ./script/run-examples jest",

"test:example:node-esm": "bash ./script/run-examples node-esm",
"test:example:node-esm-auto-loader": "bash ./script/run-examples node-esm-auto-loader",
"test:example:webpack": "bash ./script/run-examples webpack",

@@ -101,3 +104,3 @@ "version:write": "echo \"export default '$npm_package_version'\" > src/version.js",

"lodash": "^4.17.21",
"quibble": "^0.7.0",
"quibble": "^0.8.0",
"stringify-object-es5": "^2.5.0",

@@ -107,5 +110,5 @@ "theredoc": "^1.0.0"

"devDependencies": {
"@types/node": "^18.13.0",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"@types/node": "^20.6.0",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"browserify": "^17.0.0",

@@ -115,17 +118,17 @@ "codeclimate-test-reporter": "^0.5.1",

"cross-env": "^7.0.3",
"dedent": "^0.7.0",
"dedent": "^1.5.1",
"headerify": "^1.0.1",
"is-number": "^7.0.0",
"is-promise": "^4.0.0",
"mkdirp": "^2.1.3",
"mkdirp": "^3.0.1",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"rimraf": "^4.1.2",
"standard": "^17.0.0",
"teenytest": "^6.0.4",
"rimraf": "^5.0.1",
"standard": "^17.1.0",
"teenytest": "^6.0.5",
"teenytest-promise": "^1.0.0",
"testdouble": "^3.16.8",
"testdouble": "^3.18.0",
"ts-node": "^10.9.1",
"tsify": "^5.0.4",
"typescript": "^4.9.5"
"typescript": "^5.2.2"
},

@@ -157,4 +160,4 @@ "directories": {

"engines": {
"node": ">= 14"
"node": ">= 16"
}
}

@@ -100,4 +100,3 @@ # testdouble.js (AKA td.js)

Additionally, if you're using Node 13 or newer, you can specify testdouble as a
module loader and replace native ES modules with `td.replaceEsm()`. More details
Additionally, if you're using Node 16 or newer, you can replace native ES modules with `td.replaceEsm()`. More details
[here](docs/7-replacing-dependencies.md#how-module-replacement-works-for-es-modules-using-import).

@@ -104,0 +103,0 @@

@@ -5,2 +5,3 @@ import _ from '../wrap/lodash'

import replaceProperty from './property'
import { canRegisterLoader } from '../can-register-loader'

@@ -18,3 +19,3 @@ quibble.ignoreCallsFromThisFile()

export function replaceEsm (_modulePath, _namedExportReplacement, _defaultExportReplacement) {
if (!quibble.isLoaderLoaded()) {
if (!canRegisterLoader() && !quibble.isLoaderLoaded()) {
throw new Error('testdouble ESM loader not loaded. You cannot replace ES modules without a loader. Run node with `--loader=testdouble`.')

@@ -21,0 +22,0 @@ }

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

export default '3.18.0'
export default '3.19.0'

Sorry, the diff of this file is too big to display

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