Skip to content

Commit

Permalink
Update tests to expected escaped period in json extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
creationix committed Dec 12, 2024
1 parent 9599366 commit ae98fba
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 161 deletions.
2 changes: 1 addition & 1 deletion test/e2e/edge-pages-support/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('edge-render-getserversideprops', () => {
expect(manifest.dataRoutes).toEqual([
{
dataRouteRegex: normalizeRegEx(
`^/_next/data/${escapeStringRegexp(next.buildId)}/index.json$`
`^/_next/data/${escapeStringRegexp(next.buildId)}/index\\.json$`
),
page: '/',
},
Expand Down
34 changes: 17 additions & 17 deletions test/e2e/getserversideprops/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ let next: NextInstance
const expectedManifestRoutes = () => [
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/index.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/index\\.json$`
),
page: '/',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/another.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/another\\.json$`
),
page: '/another',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/blog.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/blog\\.json$`
),
page: '/blog',
},
Expand Down Expand Up @@ -83,44 +83,44 @@ const expectedManifestRoutes = () => [
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/custom-cache.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/custom-cache\\.json$`
),
page: '/custom-cache',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/default-revalidate.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/default-revalidate\\.json$`
),
page: '/default-revalidate',
},
{
dataRouteRegex: `^\\/_next\\/data\\/${escapeRegex(
buildId
)}\\/early-request-end.json$`,
)}\\/early-request-end\\.json$`,
page: '/early-request-end',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/enoent.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/enoent\\.json$`
),
page: '/enoent',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/invalid-keys.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/invalid-keys\\.json$`
),
page: '/invalid-keys',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/non-json.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/non\\-json\\.json$`
),
page: '/non-json',
},
{
dataRouteRegex: `^\\/_next\\/data\\/${escapeRegex(
buildId
)}\\/not-found.json$`,
)}\\/not-found\\.json$`,
page: '/not-found',
},
{
Expand All @@ -137,47 +137,47 @@ const expectedManifestRoutes = () => [
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/promise.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/promise\\.json$`
),
page: '/promise',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/promise\\/mutate-res.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/promise\\/mutate-res\\.json$`
),
page: '/promise/mutate-res',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(
buildId
)}\\/promise\\/mutate-res-no-streaming.json$`
)}\\/promise\\/mutate-res-no-streaming\\.json$`
),
page: '/promise/mutate-res-no-streaming',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(
buildId
)}\\/promise\\/mutate-res-props.json$`
)}\\/promise\\/mutate-res-props\\.json$`
),
page: '/promise/mutate-res-props',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/refresh.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/refresh\\.json$`
),
page: '/refresh',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/slow.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/slow\\.json$`
),
page: '/slow',
},
{
dataRouteRegex: normalizeRegEx(
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/something.json$`
`^\\/_next\\/data\\/${escapeRegex(buildId)}\\/something\\.json$`
),
page: '/something',
},
Expand Down
Loading

0 comments on commit ae98fba

Please sign in to comment.