mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
export and use distict lifecycle wrappers
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
2e38938331
commit
cbe52fefcc
5 files changed
+43
-28
No files matched your search
@@ -25,6 +25,22 @@ export function wrapJestLifecycle(fn: () => Promise<void>): (done: DoneCallback)
|
||||
};
|
||||
}
|
||||
|
||||
export function beforeAllWrapped(fn: () => Promise<void>): void {
|
||||
beforeAll(wrapJestLifecycle(fn));
|
||||
}
|
||||
|
||||
export function beforeEachWrapped(fn: () => Promise<void>): void {
|
||||
beforeEach(wrapJestLifecycle(fn));
|
||||
}
|
||||
|
||||
export function afterAllWrapped(fn: () => Promise<void>): void {
|
||||
afterAll(wrapJestLifecycle(fn));
|
||||
}
|
||||
|
||||
export function afterEachWrapped(fn: () => Promise<void>): void {
|
||||
afterEach(wrapJestLifecycle(fn));
|
||||
}
|
||||
|
||||
export function itIf(condition: boolean) {
|
||||
return condition ? it : it.skip;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user