@corez/mock
Advanced tools
Comparing version 0.13.2 to 0.13.3
@@ -59,3 +59,3 @@ "use strict"; | ||
const targetClass = value; | ||
const mockedClass = import_mock.mock.class(targetClass, targetOrOptionsOrImpl); | ||
const mockedClass = import_mock.mock.class(targetClass); | ||
const descriptors = Object.getOwnPropertyDescriptors(targetClass.prototype); | ||
@@ -62,0 +62,0 @@ for (const [key, descriptor] of Object.entries(descriptors)) { |
@@ -25,3 +25,3 @@ import RandExp from "randexp"; | ||
const targetClass = value; | ||
const mockedClass = mock.class(targetClass, targetOrOptionsOrImpl); | ||
const mockedClass = mock.class(targetClass); | ||
const descriptors = Object.getOwnPropertyDescriptors(targetClass.prototype); | ||
@@ -28,0 +28,0 @@ for (const [key, descriptor] of Object.entries(descriptors)) { |
{ | ||
"name": "@corez/mock", | ||
"version": "0.13.2", | ||
"version": "0.13.3", | ||
"description": "A powerful and flexible TypeScript mocking library for testing", | ||
@@ -56,5 +56,5 @@ "keywords": [ | ||
"@types/micromatch": "^4.0.9", | ||
"@types/node": "^22.10.7", | ||
"@typescript-eslint/eslint-plugin": "^8.20.0", | ||
"@typescript-eslint/parser": "^8.20.0", | ||
"@types/node": "^22.10.10", | ||
"@typescript-eslint/eslint-plugin": "^8.21.0", | ||
"@typescript-eslint/parser": "^8.21.0", | ||
"del-cli": "^6.0.0", | ||
@@ -65,3 +65,3 @@ "eslint": "^9.18.0", | ||
"eslint-plugin-jest": "^28.11.0", | ||
"eslint-plugin-prettier": "^5.2.2", | ||
"eslint-plugin-prettier": "^5.2.3", | ||
"eslint-plugin-simple-import-sort": "^12.1.1", | ||
@@ -68,0 +68,0 @@ "eslint-plugin-unused-imports": "^4.1.4", |
@@ -54,3 +54,3 @@ import RandExp from 'randexp'; | ||
const targetClass = value as Constructor<T>; | ||
const mockedClass = mock.class(targetClass, targetOrOptionsOrImpl as MockOptionsInput); | ||
const mockedClass = mock.class(targetClass); | ||
// Add getter mocks to prototype | ||
@@ -57,0 +57,0 @@ const descriptors = Object.getOwnPropertyDescriptors(targetClass.prototype); |
@@ -216,9 +216,9 @@ import type {Faker} from '@faker-js/faker'; | ||
// With operations | ||
with<T>(value: T): (target: any, context: DecoratorContext) => any; // ExactValue | ||
with<T>(fn: () => T): (target: any, context: DecoratorContext) => any; // Callback | ||
with(regex: RegExp): (target: any, context: DecoratorContext) => any; // Regex pattern | ||
with<T>(targetClass: Constructor<T>): (target: any, context: DecoratorContext) => any; // Class type | ||
with<T>(enumObj: {enum: Record<string, T>}): (target: any, context: DecoratorContext) => any; // EnumObject | ||
with<T>(options: {type: Constructor<T>; count: number}): (target: any, context: DecoratorContext) => any; // MultiClass | ||
withFaker<T>(fn: (faker: Faker) => T, options?: FakerOptions): (target: any, context: DecoratorContext) => any; // Faker callback with options | ||
with<T>(value: T): (target: any, context: DecoratorContext) => any; | ||
with<T>(fn: () => T): (target: any, context: DecoratorContext) => any; | ||
with(regex: RegExp): (target: any, context: DecoratorContext) => any; | ||
with<T>(targetClass: Constructor<T>): (target: any, context: DecoratorContext) => any; | ||
with<T>(enumObj: {enum: Record<string, T>}): (target: any, context: DecoratorContext) => any; | ||
with<T>(options: {type: Constructor<T>; count: number}): (target: any, context: DecoratorContext) => any; | ||
withFaker<T>(fn: (faker: Faker) => T, options?: FakerOptions): (target: any, context: DecoratorContext) => any; | ||
} | ||
@@ -225,0 +225,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
217116