Skip to content

Commit

Permalink
Fix tests for gSSP
Browse files Browse the repository at this point in the history
  • Loading branch information
nuta committed Oct 14, 2022
1 parent f0048ce commit 77956ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
@@ -1,7 +1,7 @@
export default function SSRPage({ headers }) {
return (
<>
<p id="headers">{JSON.stringify({ headers })}</p>
<p id="headers">{JSON.stringify(headers)}</p>
</>
)
}
Expand Down
Expand Up @@ -33,9 +33,11 @@ describe('Middleware Request Headers Manipulation', () => {
},
{
title: 'getServerSideProps',
path: '/api/ssr-page',
toJson: async (res: Response) =>
cheerio.load(await res.text())('#headers'),
path: '/ssr-page',
toJson: async (res: Response) => {
const $ = cheerio.load(await res.text())
return JSON.parse($('#headers').text())
},
},
])('$title Backend', ({ path, toJson }) => {
it(`Adds new headers`, async () => {
Expand Down

0 comments on commit 77956ee

Please sign in to comment.