Skip to content

Commit

Permalink
fix(dispatch): dispatchVersion never sent to the publish action (#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
kptdobe authored Jul 4, 2019
1 parent c71e4be commit ddbf0cb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ module.exports = function strain() {
.withConfigPurgeAPI(argv.apiConfigPurge)
.withFilter(argv.only, argv.exclude)
.withCustomVCLs(argv.customVCL)
.withDispatchVersion(argv.dispatchVersion)
.run();
},
};
Expand Down
17 changes: 17 additions & 0 deletions test/testPublishCli.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('hlx publish', () => {
mockPublish.withGithubToken.returnsThis();
mockPublish.withFilter.returnsThis();
mockPublish.withCustomVCLs.returnsThis();
mockPublish.withDispatchVersion.returnsThis();
mockPublish.run.returnsThis();
});

Expand Down Expand Up @@ -73,6 +74,7 @@ describe('hlx publish', () => {
sinon.assert.calledWith(mockPublish.withPublishAPI, 'foobar.api');
sinon.assert.calledWith(mockPublish.withDryRun, true);
sinon.assert.calledWith(mockPublish.withCustomVCLs, []);
sinon.assert.calledWith(mockPublish.withDispatchVersion, undefined);
});

it('hlx publish works with minimal arguments', () => {
Expand All @@ -91,6 +93,7 @@ describe('hlx publish', () => {
sinon.assert.calledWith(mockPublish.withFastlyNamespace, 'hlx'); // TODO !!
sinon.assert.calledWith(mockPublish.withFastlyAuth, 'secret-key');
sinon.assert.calledWith(mockPublish.withCustomVCLs, []);
sinon.assert.calledWith(mockPublish.withDispatchVersion, undefined);
sinon.assert.calledOnce(mockPublish.run);
});

Expand Down Expand Up @@ -128,4 +131,18 @@ describe('hlx publish', () => {

assert.fail('publish w/o github token should fail.');
});

it('hlx publish handles dispatch-version', () => {
new CLI()
.withCommandExecutor('publish', mockPublish)
.run(['publish',
'--wsk-auth', 'secret-key',
'--wsk-namespace', 'hlx',
'--fastly-auth', 'secret-key',
'--fastly-namespace', 'hlx',
'--dispatch-version', 'ci1',
]);

sinon.assert.calledWith(mockPublish.withDispatchVersion, 'ci1');
});
});

0 comments on commit ddbf0cb

Please sign in to comment.