Socket
Socket
Sign inDemoInstall

spy4js

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spy4js - npm Package Compare versions

Comparing version 4.0.0-beta.3 to 4.0.0

17

dist/registry.d.ts
type SpyRegister = {
[index: number]: {
obj: any;
method: Function;
method: (...args: any[]) => any;
methodName: string;

@@ -47,7 +47,7 @@ };

*
* @param {Object} obj -> The related object, which will be spied.
* @param {string} methodName -> The name of the mocked method.
* @param obj -> The related object, which will be spied.
* @param methodName -> The name of the mocked method.
* @return {number} -> The unique store index.
*/
push(obj: Object, methodName: keyof typeof obj): number;
push(obj: Record<string, unknown>, methodName: keyof typeof obj): number;
/**

@@ -58,3 +58,3 @@ * If called, the stored method for the corresponding index

*
* @param {number} index -> the unique identifier of stored information.
* @param index -> the unique identifier of stored information.
* @return {any} -> Any stored information can be returned.

@@ -64,3 +64,3 @@ * BUT: Usually this method returns a function or

*/
getOriginalMethod(index: number): Function | void;
getOriginalMethod(index: number): ((...args: any[]) => any) | void;
/**

@@ -71,5 +71,4 @@ * If called, the stored method will be moved from the standard

*
* @param {number} index -> the unique identifier of stored information.
* @param {boolean} intoPersReg -> boolean to determine the moving
* direction.
* @param index -> the unique identifier of stored information.
* @param intoPersReg -> boolean to determine the moving direction.
*/

@@ -76,0 +75,0 @@ persist(index: number, intoPersReg: boolean): void;

@@ -7,6 +7,6 @@ /**

*/
import { COMPARE, MAPPER, type OptionalMessageOrError, type MessageOrError } from './utils';
import { configure, configureAll } from './config';
import { type Mockable } from './mock';
import { Symbols } from './symbols';
import { configure, configureAll } from './config';
import { COMPARE, MAPPER, type MessageOrError, type OptionalMessageOrError } from './utils';
type SpyInstanceConfig = {

@@ -51,3 +51,3 @@ useOwnEquals: boolean;

[Symbols.isSpy]: boolean;
[Symbols.func]: Function;
[Symbols.func]: (...args: any[]) => any;
[Symbols.config]: SpyInstanceConfig;

@@ -60,3 +60,3 @@ [Symbols.onRestore]?: () => void;

setup: typeof configureAll;
IGNORE: Symbol;
IGNORE: symbol;
COMPARE: typeof COMPARE;

@@ -93,6 +93,6 @@ MAPPER: typeof MAPPER;

*
* @param {string} name -> the identifier of the spy.
* Useful for debugging issues.
* @param name -> the identifier of the spy.
* Useful for debugging issues.
*/
declare const Spy: ISpy;
export { Spy };

@@ -60,2 +60,2 @@ /**

declare const toError: (msgOrError: OptionalMessageOrError, spyName: string) => Error;
export { differenceOf, COMPARE, toError, MAPPER };
export { COMPARE, differenceOf, MAPPER, toError };
{
"name": "spy4js",
"version": "4.0.0-beta.3",
"version": "4.0.0",
"description": "Smart, compact and powerful spy test framework",

@@ -8,2 +8,3 @@ "main": "dist/index.cjs",

"types": "dist/index.d.ts",
"type": "module",
"files": [

@@ -29,24 +30,24 @@ "dist"

"devDependencies": {
"@sucrase/jest-plugin": "^3.0.0",
"@testing-library/react": "^14.1.2",
"@types/bun": "^1.0.1",
"@types/jest": "^29.5.11",
"@types/node": "^20.11.0",
"@types/react": "^18.2.47",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"@vitest/coverage-v8": "^1.2.0",
"coveralls": "^3.1.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sucrase": "^3.35.0",
"typescript": "^5.3.3",
"vite": "^5.0.11",
"vitest": "^1.2.0"
"@sucrase/jest-plugin": "3.0.0",
"@testing-library/react": "15.0.7",
"@types/bun": "1.1.2",
"@types/jest": "29.5.12",
"@types/node": "20.12.12",
"@types/react": "18.3.2",
"@vitest/coverage-v8": "1.6.0",
"eslint": "9.2.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-simple-import-sort": "^12.1.0",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"prettier": "3.2.5",
"react": "18.3.1",
"react-dom": "18.3.1",
"sucrase": "3.35.0",
"typescript": "5.4.5",
"typescript-eslint": "^7.9.0",
"vite": "5.2.11",
"vitest": "1.6.0"
},

@@ -57,3 +58,3 @@ "scripts": {

"lint": "pnpm lint:es && pnpm lint:ts",
"lint:es": "eslint --ext .ts src/ test/ --max-warnings 0",
"lint:es": "eslint . --max-warnings 0",
"lint:ts": "tsc",

@@ -64,5 +65,4 @@ "test": "pnpm test:jest && pnpm test:vi && pnpm test:bun",

"test:bun": "bun test",
"test:update": "jest -u",
"coveralls": "cat ./coverage/lcov.info | coveralls"
"test:update": "jest -u"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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