Skip to content

Commit e2349ce

Browse files
committed
Fix test case
1 parent 13219b5 commit e2349ce

File tree

1 file changed

+11
-3
lines changed
  • packages/next-swc/crates/next-dev-tests/tests/integration/next/env/basic/input/pages

1 file changed

+11
-3
lines changed

packages/next-swc/crates/next-dev-tests/tests/integration/next/env/basic/input/pages/index.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@ export default function Home() {
1616
}
1717

1818
function 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',

0 commit comments

Comments
 (0)