From 47e118ee5cf5d0fa75c89614ae7f816f986e3e45 Mon Sep 17 00:00:00 2001 From: Utkarsh Dixit Date: Sat, 31 Aug 2019 02:26:10 +0530 Subject: [PATCH] Add tests for show-progress and show-stats --- packages/shipit-cli/src/Shipit.test.js | 78 ++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/packages/shipit-cli/src/Shipit.test.js b/packages/shipit-cli/src/Shipit.test.js index f98a4e9..bfce4d9 100644 --- a/packages/shipit-cli/src/Shipit.test.js +++ b/packages/shipit-cli/src/Shipit.test.js @@ -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', () => { @@ -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', () => { @@ -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"], + }) + }) }) })