Skip to content

Conversation

@kravetsone
Copy link
Contributor

@kravetsone kravetsone commented Mar 28, 2025

it('return web api\'s File', async () => {
		const app = new Elysia().get('/', () => new File(['Hello'], 'hello.txt', { type: 'text/plain' }))
		const res = await app.handle(req('/'))

		expect(res.headers.get('content-type')).toBe('text/plain;charset=utf-8')
		expect(await res.text()).toBe('Hello')
		expect(res.status).toBe(200)
		expect(res.headers.get('accept-ranges')).toBe('bytes')
		expect(res.headers.get('content-range')).toBe('bytes 0-4/5')
	})

@kravetsone
Copy link
Contributor Author

@kravetsone
Copy link
Contributor Author

  • Approved

@kravetsone
Copy link
Contributor Author

i (1).jpeg

@SaltyAom SaltyAom merged commit 29928d2 into elysiajs:main May 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants