core3-utils

@wixc3/testing on Github

Home > @wixc3/testing > createDisposalGroup

createDisposalGroup() function

Creates a new disposal group

Signature:

export declare function createDisposalGroup(name: string, constraints: GroupConstraints[] | GroupConstraints): void;

Parameters

Parameter Type Description
name string disposal group name, must be unique
constraints [GroupConstraints](/core3-utils/patterns.groupconstraints.html)\[\] \| [GroupConstraints](/core3-utils/patterns.groupconstraints.html) disposal group must have constrains, either before or after another group(s)

Returns:

void

Example

it('test', () => {
     createDisposalGroup('group1', { before: DisposalGroups.DEFAULT_GROUP })
     disposeAfter(() => {}) // will be disposed in default group
     disposeAfter(() => {}, 'group1') // will be disposed before the default group
})