Skip to content

Commit

Permalink
test(ssr): proper test coverage of SSR shebang import hoisting (#14448)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtsao committed Sep 25, 2023
1 parent 8349d4e commit fdd4669
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,11 +747,13 @@ test('import hoisted after hashbang', async () => {
expect(
await ssrTransformSimpleCode(
`#!/usr/bin/env node
import "foo"`,
console.log(foo);
import foo from "foo"`,
),
).toMatchInlineSnapshot(`
"#!/usr/bin/env node
const __vite_ssr_import_0__ = await __vite_ssr_import__(\\"foo\\");
console.log(__vite_ssr_import_0__.default);
"
`)
})
Expand Down

0 comments on commit fdd4669

Please sign in to comment.