Skip to content

Commit

Permalink
Fix expectations for deploy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
unstubbable committed Jan 13, 2025
1 parent f746b4e commit e9e182d
Showing 1 changed file with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { nextTestSetup } from 'e2e-utils'

describe('use-cache-metadata-route-handler', () => {
const { next, isNextStart } = nextTestSetup({
const { next, isNextDev, isNextStart } = nextTestSetup({
files: __dirname,
})

Expand Down Expand Up @@ -41,12 +41,12 @@ describe('use-cache-metadata-route-handler', () => {

const body = await res.text()

if (isNextStart) {
if (isNextDev) {
expect(body).toMatchInlineSnapshot(`
"<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://acme.com?sentinel=buildtime</loc>
<loc>https://acme.com?sentinel=runtime</loc>
</url>
</urlset>
"
Expand All @@ -56,7 +56,7 @@ describe('use-cache-metadata-route-handler', () => {
"<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://acme.com?sentinel=runtime</loc>
<loc>https://acme.com?sentinel=buildtime</loc>
</url>
</urlset>
"
Expand All @@ -71,12 +71,12 @@ describe('use-cache-metadata-route-handler', () => {

const body = await res.text()

if (isNextStart) {
if (isNextDev) {
expect(body).toMatchInlineSnapshot(`
"<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://acme.com/1?sentinel=buildtime</loc>
<loc>https://acme.com/1?sentinel=runtime</loc>
</url>
</urlset>
"
Expand All @@ -86,7 +86,7 @@ describe('use-cache-metadata-route-handler', () => {
"<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://acme.com/1?sentinel=runtime</loc>
<loc>https://acme.com/1?sentinel=buildtime</loc>
</url>
</urlset>
"
Expand All @@ -101,17 +101,17 @@ describe('use-cache-metadata-route-handler', () => {

const body = await res.text()

if (isNextStart) {
if (isNextDev) {
expect(body).toMatchInlineSnapshot(`
"User-Agent: *
Allow: /buildtime
"
`)
"User-Agent: *
Allow: /runtime
"
`)
} else {
expect(body).toMatchInlineSnapshot(`
"User-Agent: *
Allow: /runtime
Allow: /buildtime
"
`)
Expand All @@ -125,10 +125,10 @@ describe('use-cache-metadata-route-handler', () => {

const body = await res.json()

if (isNextStart) {
expect(body).toEqual({ name: 'buildtime' })
} else {
if (isNextDev) {
expect(body).toEqual({ name: 'runtime' })
} else {
expect(body).toEqual({ name: 'buildtime' })
}
})
})

0 comments on commit e9e182d

Please # to comment.