1
1
import { nextTestSetup } from 'e2e-utils'
2
2
3
3
describe ( 'use-cache-metadata-route-handler' , ( ) => {
4
- const { next, isNextStart } = nextTestSetup ( {
4
+ const { next, isNextDev , isNextStart } = nextTestSetup ( {
5
5
files : __dirname ,
6
6
} )
7
7
@@ -41,12 +41,12 @@ describe('use-cache-metadata-route-handler', () => {
41
41
42
42
const body = await res . text ( )
43
43
44
- if ( isNextStart ) {
44
+ if ( isNextDev ) {
45
45
expect ( body ) . toMatchInlineSnapshot ( `
46
46
"<?xml version="1.0" encoding="UTF-8"?>
47
47
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
48
48
<url>
49
- <loc>https://acme.com?sentinel=buildtime </loc>
49
+ <loc>https://acme.com?sentinel=runtime </loc>
50
50
</url>
51
51
</urlset>
52
52
"
@@ -56,7 +56,7 @@ describe('use-cache-metadata-route-handler', () => {
56
56
"<?xml version="1.0" encoding="UTF-8"?>
57
57
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
58
58
<url>
59
- <loc>https://acme.com?sentinel=runtime </loc>
59
+ <loc>https://acme.com?sentinel=buildtime </loc>
60
60
</url>
61
61
</urlset>
62
62
"
@@ -71,12 +71,12 @@ describe('use-cache-metadata-route-handler', () => {
71
71
72
72
const body = await res . text ( )
73
73
74
- if ( isNextStart ) {
74
+ if ( isNextDev ) {
75
75
expect ( body ) . toMatchInlineSnapshot ( `
76
76
"<?xml version="1.0" encoding="UTF-8"?>
77
77
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
78
78
<url>
79
- <loc>https://acme.com/1?sentinel=buildtime </loc>
79
+ <loc>https://acme.com/1?sentinel=runtime </loc>
80
80
</url>
81
81
</urlset>
82
82
"
@@ -86,7 +86,7 @@ describe('use-cache-metadata-route-handler', () => {
86
86
"<?xml version="1.0" encoding="UTF-8"?>
87
87
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
88
88
<url>
89
- <loc>https://acme.com/1?sentinel=runtime </loc>
89
+ <loc>https://acme.com/1?sentinel=buildtime </loc>
90
90
</url>
91
91
</urlset>
92
92
"
@@ -101,17 +101,17 @@ describe('use-cache-metadata-route-handler', () => {
101
101
102
102
const body = await res . text ( )
103
103
104
- if ( isNextStart ) {
104
+ if ( isNextDev ) {
105
105
expect ( body ) . toMatchInlineSnapshot ( `
106
- "User-Agent: *
107
- Allow: /buildtime
108
-
109
- "
110
- ` )
106
+ "User-Agent: *
107
+ Allow: /runtime
108
+
109
+ "
110
+ ` )
111
111
} else {
112
112
expect ( body ) . toMatchInlineSnapshot ( `
113
113
"User-Agent: *
114
- Allow: /runtime
114
+ Allow: /buildtime
115
115
116
116
"
117
117
` )
@@ -125,10 +125,10 @@ describe('use-cache-metadata-route-handler', () => {
125
125
126
126
const body = await res . json ( )
127
127
128
- if ( isNextStart ) {
129
- expect ( body ) . toEqual ( { name : 'buildtime' } )
130
- } else {
128
+ if ( isNextDev ) {
131
129
expect ( body ) . toEqual ( { name : 'runtime' } )
130
+ } else {
131
+ expect ( body ) . toEqual ( { name : 'buildtime' } )
132
132
}
133
133
} )
134
134
} )
0 commit comments