Skip to content

@nestarc/soft-delete/testing API reference ​

Register TestSoftDeleteModule and use shared query-scope helpers with root imports in the same module format (CommonJS or ESM). Since 0.7.5, service tokens and context are shared and cascade configuration is honored. Use raw database delegates for deletion assertions; see the application testing guide.

Browse all @nestarc/soft-delete import paths.

Classes ​

TestSoftDeleteModule ​

Defined in: src/testing/test-soft-delete.module.ts:9

Constructors ​

Constructor ​
ts
new TestSoftDeleteModule(): TestSoftDeleteModule;
Returns ​

TestSoftDeleteModule

Methods ​

register() ​
ts
static register(options, prisma?): DynamicModule;

Defined in: src/testing/test-soft-delete.module.ts:10

Parameters ​
ParameterType
optionsPartial<SoftDeleteModuleOptions> & { softDeleteModels: string[]; }
prisma?any
Returns ​

DynamicModule

Functions ​

expectCascadeSoftDeleted() ​

ts
function expectCascadeSoftDeleted(
   prisma,
   parentModel,
   where,
   childModels,
deletedAtField?): Promise<void>;

Defined in: src/testing/expect-soft-deleted.ts:42

Parameters ​

ParameterTypeDefault value
prismaanyundefined
parentModelstringundefined
whereRecord<string, any>undefined
childModelsstring[]undefined
deletedAtFieldstring'deletedAt'

Returns ​

Promise<void>


expectNotSoftDeleted() ​

ts
function expectNotSoftDeleted(
   modelDelegate,
   where,
deletedAtField?): Promise<void>;

Defined in: src/testing/expect-soft-deleted.ts:24

Parameters ​

ParameterTypeDefault value
modelDelegateanyundefined
whereRecord<string, any>undefined
deletedAtFieldstring'deletedAt'

Returns ​

Promise<void>


expectSoftDeleted() ​

ts
function expectSoftDeleted(
   modelDelegate,
   where,
deletedAtField?): Promise<void>;

Defined in: src/testing/expect-soft-deleted.ts:3

Parameters ​

ParameterTypeDefault value
modelDelegateanyundefined
whereRecord<string, any>undefined
deletedAtFieldstring'deletedAt'

Returns ​

Promise<void>

Documentation site: MIT License. Check each package for its license.