From a399f4d82fc04e63a3358e5e7caae8c78e293c0f Mon Sep 17 00:00:00 2001 From: Kezhik Kyzyl-ool Date: Thu, 14 Mar 2024 12:05:43 +0100 Subject: [PATCH] fix: change to beforeAll and afterEach --- test/runtime.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/runtime.test.ts b/test/runtime.test.ts index 2d43f1d..7ca9614 100644 --- a/test/runtime.test.ts +++ b/test/runtime.test.ts @@ -66,7 +66,7 @@ describe('Testing runtime features', () => { let tabs: NodeListOf; let nestedTabs: NodeListOf; - beforeEach(() => { + beforeAll(() => { const {tokens, env, md} = makeTransform(); const result = md.renderer.render(tokens, {}, env); @@ -82,7 +82,11 @@ describe('Testing runtime features', () => { if (!tabs.length) { throw new Error('No tabs found'); } - }) + }); + + afterEach(() => { + tabs[0].click(); + }); test.each([0, 1, 2])('click on tab', (tabToSelectIndex) => { expect(tabs[0].classList.contains('active')).toBeTruthy();