Skip to content

Commit 7ab9abb

Browse files
committed
update test
1 parent f7e5a89 commit 7ab9abb

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/e2e/app-dir/metadata-warnings/index.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,20 @@ createNextDescribe(
1010
files: __dirname,
1111
skipDeployment: true,
1212
},
13-
({ next, isNextStart }) => {
13+
({ next, isNextDev }) => {
1414
// If it's start mode, we get the whole logs since they're from build process.
1515
// If it's dev mode, we get the logs after request
1616
function getCliOutput(logStartPosition: number) {
17-
return isNextStart
18-
? next.cliOutput
19-
: next.cliOutput.slice(logStartPosition)
17+
return isNextDev ? next.cliOutput.slice(logStartPosition) : next.cliOutput
18+
}
19+
20+
if (isNextDev) {
21+
it('should not warn metadataBase is missing if there is only absolute url', async () => {
22+
const logStartPosition = next.cliOutput.length
23+
await fetchViaHTTP(next.url, '/absolute-url-og')
24+
const output = getCliOutput(logStartPosition)
25+
expect(output).not.toInclude(METADATA_BASE_WARN_STRING)
26+
})
2027
}
2128

2229
it('should fallback to localhost if metadataBase is missing for absolute urls resolving', async () => {
@@ -30,13 +37,6 @@ createNextDescribe(
3037
)
3138
})
3239

33-
it('should not warn metadataBase is missing if there is only absolute url', async () => {
34-
const logStartPosition = next.cliOutput.length
35-
await fetchViaHTTP(next.url, '/absolute-url-og')
36-
const output = getCliOutput(logStartPosition)
37-
expect(output).not.toInclude(METADATA_BASE_WARN_STRING)
38-
})
39-
4040
it('should warn for unsupported metadata properties', async () => {
4141
const logStartPosition = next.cliOutput.length
4242
await fetchViaHTTP(next.url, '/unsupported-metadata')

0 commit comments

Comments
 (0)