Skip to content

Commit ddbf0cb

Browse files
authored
fix(dispatch): dispatchVersion never sent to the publish action (#1061)
1 parent c71e4be commit ddbf0cb

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/publish.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ module.exports = function strain() {
119119
.withConfigPurgeAPI(argv.apiConfigPurge)
120120
.withFilter(argv.only, argv.exclude)
121121
.withCustomVCLs(argv.customVCL)
122+
.withDispatchVersion(argv.dispatchVersion)
122123
.run();
123124
},
124125
};

test/testPublishCli.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ describe('hlx publish', () => {
4141
mockPublish.withGithubToken.returnsThis();
4242
mockPublish.withFilter.returnsThis();
4343
mockPublish.withCustomVCLs.returnsThis();
44+
mockPublish.withDispatchVersion.returnsThis();
4445
mockPublish.run.returnsThis();
4546
});
4647

@@ -73,6 +74,7 @@ describe('hlx publish', () => {
7374
sinon.assert.calledWith(mockPublish.withPublishAPI, 'foobar.api');
7475
sinon.assert.calledWith(mockPublish.withDryRun, true);
7576
sinon.assert.calledWith(mockPublish.withCustomVCLs, []);
77+
sinon.assert.calledWith(mockPublish.withDispatchVersion, undefined);
7678
});
7779

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

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

129132
assert.fail('publish w/o github token should fail.');
130133
});
134+
135+
it('hlx publish handles dispatch-version', () => {
136+
new CLI()
137+
.withCommandExecutor('publish', mockPublish)
138+
.run(['publish',
139+
'--wsk-auth', 'secret-key',
140+
'--wsk-namespace', 'hlx',
141+
'--fastly-auth', 'secret-key',
142+
'--fastly-namespace', 'hlx',
143+
'--dispatch-version', 'ci1',
144+
]);
145+
146+
sinon.assert.calledWith(mockPublish.withDispatchVersion, 'ci1');
147+
});
131148
});

0 commit comments

Comments
 (0)