Skip to content

Commit 942c308

Browse files
sneakypete81rpl
authored andcommitted
feat: Added release channel as optional sign parameter (simple test) (#1400)
* feat: Added release channel as optional sign parameter * test: Add test for sign channel parameter
1 parent 4eb7ca0 commit 942c308

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/cmd/sign.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export type SignParams = {|
3030
sourceDir: string,
3131
timeout: number,
3232
verbose?: boolean,
33+
channel?: string,
3334
|};
3435

3536
export type SignOptions = {
@@ -57,6 +58,7 @@ export default function sign(
5758
sourceDir,
5859
timeout,
5960
verbose,
61+
channel,
6062
}: SignParams,
6163
{
6264
build = defaultBuilder,
@@ -118,6 +120,7 @@ export default function sign(
118120
xpiPath: buildResult.extensionPath,
119121
version: manifestData.version,
120122
downloadDir: artifactsDir,
123+
channel,
121124
});
122125

123126
if (signingResult.id) {

src/program.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,11 @@ Example: $0 --help run.
412412
describe: 'Number of milliseconds to wait before giving up',
413413
type: 'number',
414414
},
415+
'channel': {
416+
describe: 'The channel for which to sign the addon. Either ' +
417+
'\'listed\' or \'unlisted\'',
418+
type: 'string',
419+
},
415420
})
416421
.command('run', 'Run the extension', commands.run, {
417422
'target': {

tests/unit/test-cmd/test.sign.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,17 @@ describe('sign', () => {
288288
}
289289
));
290290

291+
it('passes the channel parameter to the signer', () => withTempDir(
292+
(tmpDir) => {
293+
const stubs = getStubs();
294+
return sign(tmpDir, stubs, {extraArgs: {channel: 'unlisted'}})
295+
.then(() => {
296+
sinon.assert.called(stubs.signAddon);
297+
sinon.assert.calledWithMatch(stubs.signAddon, {channel: 'unlisted'});
298+
});
299+
}
300+
));
301+
291302
it('passes the verbose flag to the signer', () => withTempDir(
292303
(tmpDir) => {
293304
const stubs = getStubs();

0 commit comments

Comments
 (0)