File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
tests/integration/directive Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11import fs from 'node:fs' ;
2+ import os from 'node:os' ;
23import { join } from 'node:path' ;
34import { buildAndGetResults , queryContent } from 'test-helper' ;
45import { describe , expect , test } from 'vitest' ;
@@ -62,16 +63,19 @@ describe('shebang', async () => {
6263 } ) ;
6364
6465 describe ( 'chmod' , async ( ) => {
66+ // Windows uses Access Control Lists (ACLs) for file permissions, which are represented differently from Linux modes.
67+ const mode = os . platform ( ) === 'win32' ? 0o100644 : 0o100755 ;
68+
6569 test ( 'shebang at the beginning' , async ( ) => {
6670 const filePath = entryFiles . esm0 ! ;
6771 const fileStats = fs . statSync ( filePath ) ;
68- expect ( fileStats . mode ) . toBe ( 0o100755 ) ;
72+ expect ( fileStats . mode ) . toBe ( mode ) ;
6973 } ) ;
7074
7175 test ( 'shebang at the beginning even if minified' , async ( ) => {
7276 const filePath = entryFiles . esm1 ! ;
7377 const fileStats = fs . statSync ( filePath ) ;
74- expect ( fileStats . mode ) . toBe ( 0o100755 ) ;
78+ expect ( fileStats . mode ) . toBe ( mode ) ;
7579 } ) ;
7680 } ) ;
7781} ) ;
You can’t perform that action at this time.
0 commit comments