Skip to content

Commit

Permalink
test: Add compress from stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
q2s2t committed Oct 27, 2019
1 parent a0e8a22 commit 6a337ad
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/func/advanced.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,18 @@ describe('Functional: Advanced usage', function () {
})
expect(sevenWindows._args).to.includes('-ssc')
})

it('should be able to compress from stdin', function (done) {
const source = `${mockDir}/DirImages/architectural-design-architecture-blueprint-239886.jpg`
const archive = `${tmpDir}/advanced-stdin.7z`
const stdin = require('fs').createReadStream(source)
const seven = Seven.add(archive, '', {
fromStdin: 'public-name.jpg',
})
stdin.pipe(seven._childProcess.stdin)
seven.on('end', function () {
expect(seven.info.get('Items to compress')).to.eql('1')
done()
})
})
})

0 comments on commit 6a337ad

Please sign in to comment.