@@ -79,9 +79,12 @@ t.test('basic file unpack tests', t => {
7979t . test ( tarfile , t => {
8080const tf = path . resolve ( tars , tarfile )
8181const dir = path . resolve ( basedir , tarfile )
82+ const linkdir = path . resolve ( basedir , tarfile + '.link' )
8283t . beforeEach ( cb => {
8384rimraf . sync ( dir )
85+ rimraf . sync ( linkdir )
8486mkdirp . sync ( dir )
87+ fs . symlinkSync ( dir , linkdir )
8588cb ( )
8689} )
8790
@@ -99,12 +102,12 @@ t.test('basic file unpack tests', t => {
99102t . test ( 'async unpack' , t => {
100103t . plan ( 2 )
101104t . test ( 'strict' , t => {
102- const unpack = new Unpack ( { cwd : dir , strict : true } )
105+ const unpack = new Unpack ( { cwd : linkdir , strict : true } )
103106fs . createReadStream ( tf ) . pipe ( unpack )
104107eos ( unpack , _ => check ( t ) )
105108} )
106109t . test ( 'loose' , t => {
107- const unpack = new Unpack ( { cwd : dir } )
110+ const unpack = new Unpack ( { cwd : linkdir } )
108111fs . createReadStream ( tf ) . pipe ( unpack )
109112eos ( unpack , _ => check ( t ) )
110113} )
@@ -113,12 +116,12 @@ t.test('basic file unpack tests', t => {
113116t . test ( 'sync unpack' , t => {
114117t . plan ( 2 )
115118t . test ( 'strict' , t => {
116- const unpack = new UnpackSync ( { cwd : dir } )
119+ const unpack = new UnpackSync ( { cwd : linkdir } )
117120unpack . end ( fs . readFileSync ( tf ) )
118121check ( t )
119122} )
120123t . test ( 'loose' , t => {
121- const unpack = new UnpackSync ( { cwd : dir } )
124+ const unpack = new UnpackSync ( { cwd : linkdir } )
122125unpack . end ( fs . readFileSync ( tf ) )
123126check ( t )
124127} )
0 commit comments