Skip to content

Commit

Permalink
feat(pub): fix tests and remove yargs-debug.js
Browse files Browse the repository at this point in the history
  • Loading branch information
MarquiseRosier committed Sep 17, 2019
1 parent 9ecf22a commit 6fd1e42
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
7 changes: 5 additions & 2 deletions src/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

const yargsOpenwhisk = require('./yargs-openwhisk.js');
const yargsFastly = require('./yargs-fastly.js');
const yargsDebug = require('./yargs-debug.js');
const yargsGithub = require('./yargs-github.js');
const { makeLogger } = require('./log-common.js');

Expand All @@ -30,7 +29,6 @@ module.exports = function strain() {
builder: (yargs) => {
yargsOpenwhisk(yargs);
yargsFastly(yargs);
yargsDebug(yargs);
yargsGithub(yargs);
yargs
.option('dry-run', {
Expand Down Expand Up @@ -81,6 +79,11 @@ module.exports = function strain() {
choices: ['soft', 'hard', 'skip'],
default: 'soft',
})
.option('debug-key', {
alias: 'debugKey',
describe: 'The key to enable the X-Debug header (default is the fastly service id)',
type: 'string',
})
.conflicts('only', 'exclude')
.demandOption(
'fastly-auth',
Expand Down
20 changes: 0 additions & 20 deletions src/yargs-debug.js

This file was deleted.

15 changes: 15 additions & 0 deletions test/testPublishCli.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,19 @@ describe('hlx publish', () => {

sinon.assert.fail('hlx publish should fail with empty wsk-auth');
});

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

sinon.assert.calledWith(mockPublish.withDebugKey, 'something');
});
});

0 comments on commit 6fd1e42

Please sign in to comment.