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