From 1749bce1556e33202a2bde0209b564a0a6f97c38 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 11 Jan 2022 15:57:41 +0100 Subject: [PATCH] [FIX] test/helpers: useLogLifeCycle supports custom key --- tests/helpers.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/helpers.ts b/tests/helpers.ts index e80d0b68..9865c1af 100644 --- a/tests/helpers.ts +++ b/tests/helpers.ts @@ -137,9 +137,12 @@ const steps: string[] = []; export function logStep(step: string) { steps.push(step); } -export function useLogLifecycle() { +export function useLogLifecycle(key?: string) { const component = useComponent(); - const name = component.constructor.name; + let name = component.constructor.name; + if (key) { + name = `${name} (${key})`; + } logStep(`${name}:setup`); expect(name + ": " + status(component)).toBe(name + ": " + "new");