Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
Add tests for show-progress and show-stats
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarsh-dixit committed Aug 30, 2019
1 parent 3464ee2 commit 47e118e
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions packages/shipit-cli/src/Shipit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,36 @@ describe('Shipit', () => {
rsync: ['--bar'],
})
})

it('should support show-progress flag', () => {

shipit.setShowProgress()

shipit.remoteCopy('src', 'dest', {
direction: 'remoteToLocal',
})

expect(shipit.pool.copy).toBeCalledWith('src', 'dest', {
direction: 'remoteToLocal',
ignores: [],
rsync: ["--progress"],
})
})

it('should support show-stats flag', () => {

shipit.setShowStats()

shipit.remoteCopy('src', 'dest', {
direction: 'remoteToLocal',
})

expect(shipit.pool.copy).toBeCalledWith('src', 'dest', {
direction: 'remoteToLocal',
ignores: [],
rsync: ["--stats"],
})
})
})

describe('#copyFromRemote', () => {
Expand Down Expand Up @@ -194,6 +224,30 @@ describe('Shipit', () => {
rsync: ['--bar'],
})
})

it('should support show-progress flag', () => {

shipit.setShowProgress()

shipit.copyFromRemote('src', 'dest')

expect(shipit.pool.copyFromRemote).toBeCalledWith('src', 'dest', {
ignores: [],
rsync: ["--progress"],
})
})

it('should support show-stats flag', () => {

shipit.setShowStats()

shipit.copyFromRemote('src', 'dest')

expect(shipit.pool.copyFromRemote).toBeCalledWith('src', 'dest', {
ignores: [],
rsync: ["--stats"],
})
})
})

describe('#copyToRemote', () => {
Expand Down Expand Up @@ -234,5 +288,29 @@ describe('Shipit', () => {
rsync: ['--bar'],
})
})

it('should support show-progress flag', () => {

shipit.setShowProgress()

shipit.copyToRemote('src', 'dest')

expect(shipit.pool.copyToRemote).toBeCalledWith('src', 'dest', {
ignores: [],
rsync: ["--progress"],
})
})

it('should support show-stats flag', () => {

shipit.setShowStats()

shipit.copyToRemote('src', 'dest')

expect(shipit.pool.copyToRemote).toBeCalledWith('src', 'dest', {
ignores: [],
rsync: ["--stats"],
})
})
})
})

0 comments on commit 47e118e

Please sign in to comment.