@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
Methods
register()
ts
static register(options, prisma?): DynamicModule;Defined in: src/testing/test-soft-delete.module.ts:10
Parameters
| Parameter | Type |
|---|---|
options | Partial<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
| Parameter | Type | Default value |
|---|---|---|
prisma | any | undefined |
parentModel | string | undefined |
where | Record<string, any> | undefined |
childModels | string[] | undefined |
deletedAtField | string | 'deletedAt' |
Returns
Promise<void>
expectNotSoftDeleted()
ts
function expectNotSoftDeleted(
modelDelegate,
where,
deletedAtField?): Promise<void>;Defined in: src/testing/expect-soft-deleted.ts:24
Parameters
| Parameter | Type | Default value |
|---|---|---|
modelDelegate | any | undefined |
where | Record<string, any> | undefined |
deletedAtField | string | 'deletedAt' |
Returns
Promise<void>
expectSoftDeleted()
ts
function expectSoftDeleted(
modelDelegate,
where,
deletedAtField?): Promise<void>;Defined in: src/testing/expect-soft-deleted.ts:3
Parameters
| Parameter | Type | Default value |
|---|---|---|
modelDelegate | any | undefined |
where | Record<string, any> | undefined |
deletedAtField | string | 'deletedAt' |
Returns
Promise<void>