@@ -370,7 +370,7 @@ test('overwrite bindings', async () => {
370
370
`const a = { inject }\n` +
371
371
`const b = { test: inject }\n` +
372
372
`function c() { const { test: inject } = { test: true }; console.log(inject) }\n` +
373
- `const d = inject \n` +
373
+ `const d = inject\n` +
374
374
`function f() { console.log(inject) }\n` +
375
375
`function e() { const { inject } = { inject: true } }\n` +
376
376
`function g() { const f = () => { const inject = true }; console.log(inject) }\n` ,
@@ -383,7 +383,7 @@ test('overwrite bindings', async () => {
383
383
const a = { inject: __vite_ssr_import_0__.inject }
384
384
const b = { test: __vite_ssr_import_0__.inject }
385
385
function c() { const { test: inject } = { test: true }; console.log(inject) }
386
- const d = __vite_ssr_import_0__.inject
386
+ const d = __vite_ssr_import_0__.inject
387
387
function f() { console.log(__vite_ssr_import_0__.inject) }
388
388
function e() { const { inject } = { inject: true } }
389
389
function g() { const f = () => { const inject = true }; console.log(__vite_ssr_import_0__.inject) }
@@ -719,3 +719,20 @@ export default (function getRandom() {
719
719
( await ssrTransform ( `export default (class A {});` , null , null ) ) . code
720
720
) . toMatchInlineSnapshot ( `"__vite_ssr_exports__.default = (class A {});"` )
721
721
} )
722
+
723
+ // #8002
724
+ test ( 'with hashbang' , async ( ) => {
725
+ expect (
726
+ (
727
+ await ssrTransform (
728
+ `#!/usr/bin/env node
729
+ console.log("it can parse the hashbang")` ,
730
+ null ,
731
+ null
732
+ )
733
+ ) . code
734
+ ) . toMatchInlineSnapshot ( `
735
+ "#!/usr/bin/env node
736
+ console.log(\\"it can parse the hashbang\\")"
737
+ ` )
738
+ } )
0 commit comments