Fix so util test on 7zip will log 7zip output on errors
Some checks failed
continuous-integration/appveyor/branch AppVeyor build failed
Some checks failed
continuous-integration/appveyor/branch AppVeyor build failed
This commit is contained in:
parent
f008af597d
commit
47b8ac2ebb
1 changed files with 28 additions and 3 deletions
|
@ -202,7 +202,16 @@ t.describe('#extractFile()', function() {
|
|||
assert.isRejected(fs.stat(util.getPathFromRoot('./testapp/file2.txt'))),
|
||||
])
|
||||
|
||||
await util.extractFile(util.getPathFromRoot('./testapp/example.7z'))
|
||||
let log = ''
|
||||
try {
|
||||
await util.extractFile(util.getPathFromRoot('./testapp/example.7z'), function(msg) {
|
||||
log += msg + '\n'
|
||||
})
|
||||
} catch (err) {
|
||||
console.log(log)
|
||||
console.log(err)
|
||||
throw err
|
||||
}
|
||||
|
||||
let stats = await Promise.all([
|
||||
fs.stat(util.getPathFromRoot('./testapp/file1.txt')),
|
||||
|
@ -218,7 +227,16 @@ t.describe('#extractFile()', function() {
|
|||
assert.isRejected(fs.stat(util.getPathFromRoot('./testapp/file2.txt'))),
|
||||
])
|
||||
|
||||
await util.extractFile(util.getPathFromRoot('./testapp/example.tar.gz'))
|
||||
let log = ''
|
||||
try {
|
||||
await util.extractFile(util.getPathFromRoot('./testapp/example.tar.gz'), function(msg) {
|
||||
log += msg + '\n'
|
||||
})
|
||||
} catch (err) {
|
||||
console.log(log)
|
||||
console.log(err)
|
||||
throw err
|
||||
}
|
||||
|
||||
let stats = await Promise.all([
|
||||
fs.stat(util.getPathFromRoot('./testapp/file1.txt')),
|
||||
|
@ -232,7 +250,14 @@ t.describe('#extractFile()', function() {
|
|||
|
||||
t.test('should stream the process of extracting', async function() {
|
||||
let output = ''
|
||||
|
||||
try {
|
||||
await util.extractFile(util.getPathFromRoot('./testapp/example.tar.gz'), function(msg) { output += msg + '\n' })
|
||||
} catch (err) {
|
||||
console.log(output)
|
||||
console.log(err)
|
||||
throw err
|
||||
}
|
||||
|
||||
assert.match(output, /Extracting archive\:.+example.tar.gz/)
|
||||
assert.match(output, /1 file, 123 bytes/)
|
||||
|
|
Loading…
Reference in a new issue