/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
test/production/sharp-api/sharp-api.test.ts
23 строки
671 B
Tim Neutkens
Convert test/integration to isolated tests (#93247)
11 май 2026, 14:55
Не верифицирован
11 май 2026, 14:55
8141dcf
Код
Авторство
О чём код?
import { nextTestSetup } from 'e2e-utils' describe('sharp api', () => { const { next } = nextTestSetup({ files: __dirname, dependencies: { sharp: '^0.34.5', }, }) it('should handle custom sharp usage', async () => { const res = await next.fetch('/api/custom-sharp') expect(res.status).toBe(200) expect(res.headers.get('content-type')).toBe('image/png') expect((await res.arrayBuffer()).byteLength).toBeGreaterThan(0) const traceFile = await next.readJSON( '.next/server/pages/api/custom-sharp.js.nft.json' ) expect( traceFile.files.some((file: string) => file.includes('sharp/')) ).toBe(true) }) })