@@ -8,7 +8,7 @@ describe('typed-env', () => {
8
8
9
9
it ( 'should have env types from next config' , async ( ) => {
10
10
await retry ( async ( ) => {
11
- const envDTS = await next . readFile ( '. next/types/env.d.ts' )
11
+ const envDTS = await next . readFile ( ` ${ next . distDir } /types/env.d.ts` )
12
12
// since NODE_ENV is development, env types will
13
13
// not include production-specific env
14
14
expect ( envDTS ) . not . toContain ( 'FROM_ENV_PROD' )
@@ -39,7 +39,7 @@ describe('typed-env', () => {
39
39
40
40
it ( 'should rewrite env types if .env is modified' , async ( ) => {
41
41
await retry ( async ( ) => {
42
- const content = await next . readFile ( '. next/types/env.d.ts' )
42
+ const content = await next . readFile ( ` ${ next . distDir } /types/env.d.ts` )
43
43
expect ( content ) . toContain ( 'FROM_ENV' )
44
44
} )
45
45
@@ -50,7 +50,7 @@ describe('typed-env', () => {
50
50
// e.g. FROM_ENV?: string
51
51
// but have MODIFIED_ENV?: string
52
52
await retry ( async ( ) => {
53
- const content = await next . readFile ( '. next/types/env.d.ts' )
53
+ const content = await next . readFile ( ` ${ next . distDir } /types/env.d.ts` )
54
54
expect ( content ) . toMatchInlineSnapshot ( `
55
55
"// Type definitions for Next.js environment variables
56
56
declare global {
0 commit comments