Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(context): make fetch Response headers mutable #3318

Merged
merged 8 commits into from
Sep 8, 2024
Merged
Prev Previous commit
Next Next commit
test(runtime-node): specify ip address as numbers
  • Loading branch information
yusukebe committed Sep 6, 2024
commit e74392986100d7bed6fa4b766e20b6e66bc3bf24
2 changes: 1 addition & 1 deletion runtime_tests/node/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { basicAuth } from '../../src/middleware/basic-auth'
import { jwt } from '../../src/middleware/jwt'
import { compress } from '../../src/middleware/compress'
import { HonoRequest } from '../../src/request'

Check warning on line 10 in runtime_tests/node/index.test.ts

View workflow job for this annotation

GitHub Actions / Main

'HonoRequest' is defined but never used
import { stream, streamSSE } from '../../src/helper/streaming'

// Test only minimal patterns.
Expand Down Expand Up @@ -230,7 +230,7 @@
const app = new Hono()
app.use(compress())
app.get('/fetch/:file', (c) => {
return fetch(`http://localhost:${externalPort}/${c.req.param('file')}`)
return fetch(`http://127.0.0.1:${externalPort}/${c.req.param('file')}`)
})
const server = createAdaptorServer(app)

Expand All @@ -241,7 +241,7 @@
it('Should be compressed a fetch response', async () => {
const res = await request(server).get('/fetch/style.css')
expect(res.status).toBe(200)
expect(res.headers['content-encoding']).toBe('gzip')

Check failure on line 244 in runtime_tests/node/index.test.ts

View workflow job for this annotation

GitHub Actions / Node.js v18.18.2

runtime_tests/node/index.test.ts > compress > Should be compressed a fetch response

AssertionError: expected undefined to be 'gzip' // Object.is equality - Expected: "gzip" + Received: undefined ❯ runtime_tests/node/index.test.ts:244:45

Check failure on line 244 in runtime_tests/node/index.test.ts

View workflow job for this annotation

GitHub Actions / Node.js v20.x

runtime_tests/node/index.test.ts > compress > Should be compressed a fetch response

AssertionError: expected undefined to be 'gzip' // Object.is equality - Expected: "gzip" + Received: undefined ❯ runtime_tests/node/index.test.ts:244:45

Check failure on line 244 in runtime_tests/node/index.test.ts

View workflow job for this annotation

GitHub Actions / Node.js v22.x

runtime_tests/node/index.test.ts > compress > Should be compressed a fetch response

AssertionError: expected undefined to be 'gzip' // Object.is equality - Expected: "gzip" + Received: undefined ❯ runtime_tests/node/index.test.ts:244:45
expect(res.text).toBe('body { color: red; }')
})
})
Loading