Skip to content

Commit

Permalink
test(image-optimizer): trailingSlash support
Browse files Browse the repository at this point in the history
  • Loading branch information
fliptheweb committed Mar 7, 2022
1 parent 788a3d1 commit d23b27f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/integration/image-optimizer/test/index.test.js
Expand Up @@ -327,6 +327,32 @@ describe('Image Optimizer', () => {
runTests(ctx)
})

describe('Server support for trailingSlash in next.config.js', () => {
let app
let appPort
beforeAll(async () => {
nextConfig.replace(
'{ /* replaceme */ }',
JSON.stringify({
trailingSlash: true,
})
)
appPort = await findPort()
app = await launchApp(appDir, appPort)
})
afterAll(async () => {
await killApp(app)
nextConfig.restore()
})

it('should return successful response for original loader', async () => {
let res
const query = { url: '/test.png', w: 8, q: 70 }
res = await fetchViaHTTP(appPort, '/_next/image/', query)
expect(res.status).toBe(200)
})
})

describe('Server support for headers in next.config.js', () => {
const size = 96 // defaults defined in server/config.ts
let app
Expand Down

0 comments on commit d23b27f

Please sign in to comment.