diff --git a/src/hooks/fetch.test.ts b/src/hooks/fetch.test.ts index 48887e9ef..42d6f18f1 100644 --- a/src/hooks/fetch.test.ts +++ b/src/hooks/fetch.test.ts @@ -1,11 +1,14 @@ /* * @group node18 */ -describe('fetch', () => { - test('beforeFetch', async () => { - // @ts-ignore - const response = await fetch('https://example.com/'); +const [nodeVersionMajor] = process.versions.node.split('.').map(Number); +if (nodeVersionMajor >= 18) { + describe('fetch', () => { + test('beforeFetch', async () => { + // @ts-ignore + const response = await fetch('https://example.com/'); - expect(response.status).toBe(200); + expect(response.status).toBe(200); + }); }); -}); +}