Skip to content

Commit

Permalink
test(runtime-node): use large date to test compress
Browse files Browse the repository at this point in the history
  • Loading branch information
usualoma authored and yusukebe committed Sep 6, 2024
1 parent 2b3d755 commit 00d4bf1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions runtime_tests/node/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,11 @@ describe('streamSSE', () => {
})

describe('compress', async () => {
const cssContent = Array.from({ length: 60 }, () => 'body { color: red; }').join('\n')
const [externalServer, serverInfo] = await new Promise<[Server, AddressInfo]>((resolve) => {
const externalApp = new Hono()
externalApp.get('/style.css', (c) =>
c.text('body { color: red; }', {
c.text(cssContent, {
headers: {
'Content-Type': 'text/css',
},
Expand Down Expand Up @@ -242,6 +243,6 @@ describe('compress', async () => {
const res = await request(server).get('/fetch/style.css')
expect(res.status).toBe(200)
expect(res.headers['content-encoding']).toBe('gzip')
expect(res.text).toBe('body { color: red; }')
expect(res.text).toBe(cssContent)
})
})

0 comments on commit 00d4bf1

Please sign in to comment.