File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ for (const module of builtinModules) {
1818 const unenvMod = await import ( `../src/runtime/node/${ module } .ts` ) ;
1919
2020 const supportedExports = [ ] as string [ ] ;
21- const unsupportedExports = [ ] as string [ ] ;
22- const extraExports = [ ] as string [ ] ;
21+ let unsupportedExports = [ ] as string [ ] ;
22+ let extraExports = [ ] as string [ ] ;
2323
2424 // Make sure named exports are covered
2525 for ( const exportName of Object . getOwnPropertyNames ( nodeMod ) ) {
@@ -71,6 +71,21 @@ for (const module of builtinModules) {
7171 }
7272 }
7373
74+ if ( module === 'constants' ) {
75+ // TODO: Should we remove this always?
76+ const osConstants = [
77+ // not availablein macos
78+ 'O_SYMLINK' ,
79+ 'SIGINFO' ,
80+ // macos specific
81+ 'O_DIRECT' ,
82+ 'O_NOATIME'
83+ ]
84+ const isOsSpecific = ( name : string ) => name => ! osConstants . find ( c => name === c || name === `default.${ c } ` )
85+ unsupportedExports = unsupportedExports . filter ( name => ! isOsSpecific ( name ) )
86+ extraExports = unsupportedExports . filter ( name => ! isOsSpecific ( name ) )
87+ }
88+
7489 modulesCoverage . push ( {
7590 name : module ,
7691 supportedExports,
You can’t perform that action at this time.
0 commit comments