Skip to content

Commit

Permalink
ci: Find coverage error part1
Browse files Browse the repository at this point in the history
  • Loading branch information
q2s2t committed Oct 13, 2018
1 parent 7cd9e37 commit 0a534b9
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions test/func/add.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,37 @@ describe('Functional: add()', function () {
done()
})

it('should return an error on 7z error', function (done) {
const archive = `${tmpDir}/addnot.7z`
const source = `${mockDir}/dev/null`
const seven = add(archive, source)
seven.on('error', function (err) {
expect(err).to.be.an.instanceof(Error)
expect(err.level).to.equal('WARNING')
expect(err.message).to.equal('No such file or directory')
expect(err.path).to.equal(source)
done()
try { kill(seven._childProcess.pid) } catch (e) {}
})
})
// it('should return an error on 7z error', function (done) {
// const archive = `${tmpDir}/addnot.7z`
// const source = `${mockDir}/dev/null`
// const seven = add(archive, source)
// seven.on('error', function (err) {
// expect(err).to.be.an.instanceof(Error)
// expect(err.level).to.equal('WARNING')
// expect(err.message).to.equal('No such file or directory')
// expect(err.path).to.equal(source)
// done()
// try { kill(seven._childProcess.pid) } catch (e) {}
// })
// })

it('should return an error on spawn error', function (done) {
const archive = ``
const source = ``
const bin = '/i/hope/this/is/not/where/yout/7zip/bin/is'
const seven = add(archive, source, {
$bin: bin
// or this test will fail
})
seven.on('error', function (err) {
expect(err).to.be.an.instanceof(Error)
expect(err.errno).to.equal('ENOENT')
expect(err.code).to.equal('ENOENT')
expect(err.syscall).to.equal(`spawn ${bin}`)
expect(err.path).to.equal(bin)
done()
})
})
// it('should return an error on spawn error', function (done) {
// const archive = ``
// const source = ``
// const bin = '/i/hope/this/is/not/where/yout/7zip/bin/is'
// const seven = add(archive, source, {
// $bin: bin
// // or this test will fail
// })
// seven.on('error', function (err) {
// expect(err).to.be.an.instanceof(Error)
// expect(err.errno).to.equal('ENOENT')
// expect(err.code).to.equal('ENOENT')
// expect(err.syscall).to.equal(`spawn ${bin}`)
// expect(err.path).to.equal(bin)
// done()
// })
// })

it('should emit progress values', function (done) {
const archive = `${tmpDir}/progress.7z`
Expand Down

0 comments on commit 0a534b9

Please sign in to comment.