diff options
Diffstat (limited to 'tests/signup.spec.ts')
| -rw-r--r-- | tests/signup.spec.ts | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/tests/signup.spec.ts b/tests/signup.spec.ts index 43cc33a..1317049 100644 --- a/tests/signup.spec.ts +++ b/tests/signup.spec.ts @@ -4,24 +4,12 @@ import { getByText, getByTestId, } from '@testing-library/dom' -import { readFile } from 'node:fs/promises' import '@testing-library/jest-dom' - -import { render } from '../src' - -async function loadFixture(type: string) { - document.documentElement.innerHTML = await readFile( - `./tests/fixtures/${type}/index.html`, - 'utf8', - ) - await render({ root: document.body }) -} - -const delay = (delayMs: number) => new Promise(res => setTimeout(res, delayMs)) +import { delay, loadHTMLFixture } from './util' describe('signup example', () => { beforeEach(async () => { - await loadFixture('signup') + await loadHTMLFixture('signup') window.fetch = jest.fn() as any }) |
