Skip to content

Commit fdd4669

Browse files
authored
test(ssr): proper test coverage of SSR shebang import hoisting (#14448)
1 parent 8349d4e commit fdd4669

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -747,11 +747,13 @@ test('import hoisted after hashbang', async () => {
747747
expect(
748748
await ssrTransformSimpleCode(
749749
`#!/usr/bin/env node
750-
import "foo"`,
750+
console.log(foo);
751+
import foo from "foo"`,
751752
),
752753
).toMatchInlineSnapshot(`
753754
"#!/usr/bin/env node
754755
const __vite_ssr_import_0__ = await __vite_ssr_import__(\\"foo\\");
756+
console.log(__vite_ssr_import_0__.default);
755757
"
756758
`)
757759
})

0 commit comments

Comments
 (0)