Skip to content

Commit 9a87d20

Browse files
authored
[test] Unflake typed-env suite (#85410)
1 parent 5e28280 commit 9a87d20

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

test/development/app-dir/typed-env/typed-env.test.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { outdent } from 'outdent'
12
import { nextTestSetup } from 'e2e-utils'
23
import { retry } from 'next-test-utils'
34

@@ -14,8 +15,9 @@ describe('typed-env', () => {
1415
expect(envDTS).not.toContain('FROM_ENV_PROD')
1516
expect(envDTS).not.toContain('FROM_ENV_PROD_LOCAL')
1617

17-
expect(envDTS).toMatchInlineSnapshot(`
18-
"// Type definitions for Next.js environment variables
18+
expect(envDTS).toEqual(
19+
outdent`
20+
// Type definitions for Next.js environment variables
1921
declare global {
2022
namespace NodeJS {
2123
interface ProcessEnv {
@@ -32,8 +34,9 @@ describe('typed-env', () => {
3234
}
3335
}
3436
}
35-
export {}"
36-
`)
37+
export {}
38+
`.trim()
39+
)
3740
})
3841
})
3942

@@ -51,8 +54,9 @@ describe('typed-env', () => {
5154
// but have MODIFIED_ENV?: string
5255
await retry(async () => {
5356
const content = await next.readFile(`${next.distDir}/types/env.d.ts`)
54-
expect(content).toMatchInlineSnapshot(`
55-
"// Type definitions for Next.js environment variables
57+
expect(content).toEqual(
58+
outdent`
59+
// Type definitions for Next.js environment variables
5660
declare global {
5761
namespace NodeJS {
5862
interface ProcessEnv {
@@ -69,8 +73,9 @@ describe('typed-env', () => {
6973
}
7074
}
7175
}
72-
export {}"
73-
`)
76+
export {}
77+
`.trim()
78+
)
7479
})
7580
})
7681

0 commit comments

Comments
 (0)