Skip to content

Commit

Permalink
Update redirect test
Browse files Browse the repository at this point in the history
  • Loading branch information
colepeters committed May 6, 2024
1 parent e43cf42 commit 2b9e8fb
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions test/backend/redirect-map-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import test from 'tape'
import { redirect, tempRedirects, permanentRedirects } from '../../src/shared/redirect-map.mjs'

test('redirect map middleware', async t => {
t.plan(5)
t.plan(4)

t.equal(typeof redirect, 'function', 'Redirect middleware is a function')

Expand All @@ -24,22 +24,6 @@ test('redirect map middleware', async t => {
}
t.deepEqual(redirectResponse, expectedResponse, 'Correctly redirect permanent mapped path')

const tempRedirectResponse = await redirect({
requestContext: {
http: {
method: 'GET',
path: '/',
}
}
})
const expectedTempResponse = {
statusCode: 302,
headers: {
location: '/docs/en/get-started/quickstart',
},
}
t.deepEqual(tempRedirectResponse, expectedTempResponse, 'Correctly redirect temporary mapped path')

const nonRedirectResponse = await redirect({
requestContext: {
http: {
Expand Down

0 comments on commit 2b9e8fb

Please sign in to comment.