@@ -11,7 +11,7 @@ describe('ESM in main field', { concurrency: true }, () => {
1111 before ( ( ) => tmpdir . refresh ( ) ) ;
1212
1313 it ( 'should handle fully-specified relative path without any warning' , async ( ) => {
14- const cwd = path . join ( tmpdir . path , Math . random ( ) . toString ( ) ) ;
14+ const cwd = tmpdir . resolve ( Math . random ( ) . toString ( ) ) ;
1515 const pkgPath = path . join ( cwd , './node_modules/pkg/' ) ;
1616 await mkdir ( pkgPath , { recursive : true } ) ;
1717 await writeFile ( path . join ( pkgPath , './index.js' ) , 'console.log("Hello World!")' ) ;
@@ -29,7 +29,7 @@ describe('ESM in main field', { concurrency: true }, () => {
2929 assert . strictEqual ( code , 0 ) ;
3030 } ) ;
3131 it ( 'should handle fully-specified absolute path without any warning' , async ( ) => {
32- const cwd = path . join ( tmpdir . path , Math . random ( ) . toString ( ) ) ;
32+ const cwd = tmpdir . resolve ( Math . random ( ) . toString ( ) ) ;
3333 const pkgPath = path . join ( cwd , './node_modules/pkg/' ) ;
3434 await mkdir ( pkgPath , { recursive : true } ) ;
3535 await writeFile ( path . join ( pkgPath , './index.js' ) , 'console.log("Hello World!")' ) ;
@@ -48,7 +48,7 @@ describe('ESM in main field', { concurrency: true }, () => {
4848 } ) ;
4949
5050 it ( 'should emit warning when "main" and "exports" are missing' , async ( ) => {
51- const cwd = path . join ( tmpdir . path , Math . random ( ) . toString ( ) ) ;
51+ const cwd = tmpdir . resolve ( Math . random ( ) . toString ( ) ) ;
5252 const pkgPath = path . join ( cwd , './node_modules/pkg/' ) ;
5353 await mkdir ( pkgPath , { recursive : true } ) ;
5454 await writeFile ( path . join ( pkgPath , './index.js' ) , 'console.log("Hello World!")' ) ;
@@ -65,7 +65,7 @@ describe('ESM in main field', { concurrency: true }, () => {
6565 assert . strictEqual ( code , 0 ) ;
6666 } ) ;
6767 it ( 'should emit warning when "main" is falsy' , async ( ) => {
68- const cwd = path . join ( tmpdir . path , Math . random ( ) . toString ( ) ) ;
68+ const cwd = tmpdir . resolve ( Math . random ( ) . toString ( ) ) ;
6969 const pkgPath = path . join ( cwd , './node_modules/pkg/' ) ;
7070 await mkdir ( pkgPath , { recursive : true } ) ;
7171 await writeFile ( path . join ( pkgPath , './index.js' ) , 'console.log("Hello World!")' ) ;
@@ -83,7 +83,7 @@ describe('ESM in main field', { concurrency: true }, () => {
8383 assert . strictEqual ( code , 0 ) ;
8484 } ) ;
8585 it ( 'should emit warning when "main" is a relative path without extension' , async ( ) => {
86- const cwd = path . join ( tmpdir . path , Math . random ( ) . toString ( ) ) ;
86+ const cwd = tmpdir . resolve ( Math . random ( ) . toString ( ) ) ;
8787 const pkgPath = path . join ( cwd , './node_modules/pkg/' ) ;
8888 await mkdir ( pkgPath , { recursive : true } ) ;
8989 await writeFile ( path . join ( pkgPath , './index.js' ) , 'console.log("Hello World!")' ) ;
@@ -101,7 +101,7 @@ describe('ESM in main field', { concurrency: true }, () => {
101101 assert . strictEqual ( code , 0 ) ;
102102 } ) ;
103103 it ( 'should emit warning when "main" is an absolute path without extension' , async ( ) => {
104- const cwd = path . join ( tmpdir . path , Math . random ( ) . toString ( ) ) ;
104+ const cwd = tmpdir . resolve ( Math . random ( ) . toString ( ) ) ;
105105 const pkgPath = path . join ( cwd , './node_modules/pkg/' ) ;
106106 await mkdir ( pkgPath , { recursive : true } ) ;
107107 await writeFile ( path . join ( pkgPath , './index.js' ) , 'console.log("Hello World!")' ) ;
0 commit comments