@@ -79,9 +79,12 @@ t.test('basic file unpack tests', t => {
79
79
t . test ( tarfile , t => {
80
80
const tf = path . resolve ( tars , tarfile )
81
81
const dir = path . resolve ( basedir , tarfile )
82
+ const linkdir = path . resolve ( basedir , tarfile + '.link' )
82
83
t . beforeEach ( cb => {
83
84
rimraf . sync ( dir )
85
+ rimraf . sync ( linkdir )
84
86
mkdirp . sync ( dir )
87
+ fs . symlinkSync ( dir , linkdir )
85
88
cb ( )
86
89
} )
87
90
@@ -99,12 +102,12 @@ t.test('basic file unpack tests', t => {
99
102
t . test ( 'async unpack' , t => {
100
103
t . plan ( 2 )
101
104
t . test ( 'strict' , t => {
102
- const unpack = new Unpack ( { cwd : dir , strict : true } )
105
+ const unpack = new Unpack ( { cwd : linkdir , strict : true } )
103
106
fs . createReadStream ( tf ) . pipe ( unpack )
104
107
eos ( unpack , _ => check ( t ) )
105
108
} )
106
109
t . test ( 'loose' , t => {
107
- const unpack = new Unpack ( { cwd : dir } )
110
+ const unpack = new Unpack ( { cwd : linkdir } )
108
111
fs . createReadStream ( tf ) . pipe ( unpack )
109
112
eos ( unpack , _ => check ( t ) )
110
113
} )
@@ -113,12 +116,12 @@ t.test('basic file unpack tests', t => {
113
116
t . test ( 'sync unpack' , t => {
114
117
t . plan ( 2 )
115
118
t . test ( 'strict' , t => {
116
- const unpack = new UnpackSync ( { cwd : dir } )
119
+ const unpack = new UnpackSync ( { cwd : linkdir } )
117
120
unpack . end ( fs . readFileSync ( tf ) )
118
121
check ( t )
119
122
} )
120
123
t . test ( 'loose' , t => {
121
- const unpack = new UnpackSync ( { cwd : dir } )
124
+ const unpack = new UnpackSync ( { cwd : linkdir } )
122
125
unpack . end ( fs . readFileSync ( tf ) )
123
126
check ( t )
124
127
} )
0 commit comments