File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
packages/next-swc/crates/next-dev-tests/tests/integration/next/env/basic/input/pages Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,17 @@ export default function Home() {
1616}
1717
1818function runTests ( ) {
19- it ( 'test' , function ( ) {
20- const json = JSON . parse ( document . body . textContent )
21- expect ( json ) . toEqual ( {
19+ it ( 'should have access to ENV on server' , function ( ) {
20+ const json = JSON . parse ( document . body . innerText )
21+ expect ( json ) . toMatchObject ( {
22+ NEXT_PUBLIC_ENV : '.env' ,
23+ NEXT_PUBLIC_ENV_DEV : '.env.development' ,
24+ NEXT_PUBLIC_ENV_LOCAL : '.env.local' ,
25+ } )
26+ } )
27+
28+ it ( 'should expose NEXT_PUBLIC_ ENV on client' , function ( ) {
29+ expect ( process . env ) . toMatchObject ( {
2230 NEXT_PUBLIC_ENV : '.env' ,
2331 NEXT_PUBLIC_ENV_DEV : '.env.development' ,
2432 NEXT_PUBLIC_ENV_LOCAL : '.env.local' ,
You can’t perform that action at this time.
0 commit comments