Skip to content

Commit

Permalink
fix: change to beforeAll and afterEach
Browse files Browse the repository at this point in the history
  • Loading branch information
Kezhik Kyzyl-ool committed Mar 14, 2024
1 parent edce29a commit a399f4d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('Testing runtime features', () => {
let tabs: NodeListOf<HTMLElement>;
let nestedTabs: NodeListOf<HTMLElement>;

beforeEach(() => {
beforeAll(() => {
const {tokens, env, md} = makeTransform();
const result = md.renderer.render(tokens, {}, env);

Expand All @@ -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();
Expand Down

0 comments on commit a399f4d

Please sign in to comment.