diff --git a/.wiby.json b/.wiby.json index 83a56ce..84e71b9 100644 --- a/.wiby.json +++ b/.wiby.json @@ -10,5 +10,5 @@ "repository": "git+https://github.com/wiby-test/pass" } ], - "pullrequest": false + "pullRequest": false } diff --git a/bin/commands/result.js b/bin/commands/result.js index 62c705e..0865130 100644 --- a/bin/commands/result.js +++ b/bin/commands/result.js @@ -10,7 +10,7 @@ exports.builder = (yargs) => yargs type: 'string', conflicts: 'config' }) - .option('pullrequest', { + .option('pull-request', { desc: 'close a draft PR created in the test phase', alias: 'pr', type: 'boolean', @@ -25,7 +25,7 @@ exports.handler = async (params) => { const config = params.dependent ? { dependents: [{ repository: params.dependent }], - pullrequest: !!params.pullrequest + pullRequest: !!params['pull-request'] } : wiby.validate({ config: params.config }) diff --git a/bin/commands/test.js b/bin/commands/test.js index cdceefa..2d2dab9 100644 --- a/bin/commands/test.js +++ b/bin/commands/test.js @@ -10,7 +10,7 @@ exports.builder = (yargs) => yargs type: 'string', conflicts: 'config' }) - .option('pullrequest', { + .option('pull-request', { desc: 'Raise a draft PR in addition to creating a branch', alias: 'pr', type: 'boolean', @@ -25,7 +25,7 @@ exports.handler = (params) => { const config = params.dependent ? { dependents: [{ repository: params.dependent }], - pullrequest: !!params.pullrequest + pullRequest: !!params['pull-request'] } : wiby.validate({ config: params.config }) diff --git a/lib/config.js b/lib/config.js index 6ea394d..c8bcb53 100644 --- a/lib/config.js +++ b/lib/config.js @@ -18,7 +18,7 @@ const dependentSchema = joi.object({ exports.schema = joi.object({ dependents: joi.array().items(dependentSchema), - pullrequest: joi.boolean().optional() + pullRequest: joi.boolean().optional() }).unknown(false) diff --git a/lib/result.js b/lib/result.js index 9d2c7b9..748dcd7 100644 --- a/lib/result.js +++ b/lib/result.js @@ -17,7 +17,7 @@ const pipelineStatusesEnum = module.exports.pipelineStatusesEnum = Object.freeze const PENDING_RESULT_EXIT_CODE = 64 -module.exports = async function ({ dependents, pullrequest }) { +module.exports = async function ({ dependents, pullRequest }) { const parentPkgJSON = await context.getLocalPackageJSON() const parentPkgInfo = gitURLParse(parentPkgJSON.repository.url) const output = { status: pipelineStatusesEnum.PENDING, results: [] } diff --git a/lib/test.js b/lib/test.js index 4801e32..503926a 100644 --- a/lib/test.js +++ b/lib/test.js @@ -9,7 +9,7 @@ const logger = require('./logger') const testCommandNamespace = 'wiby:test' const debug = logger(testCommandNamespace) -module.exports = async function ({ dependents, pullrequest }) { +module.exports = async function ({ dependents, pullRequest }) { // enable log output for test command without DEBUG env logger.enableLogs(testCommandNamespace) @@ -32,7 +32,7 @@ module.exports = async function ({ dependents, pullrequest }) { const patchedPackageJSON = applyPatch(parentDependencyLink, parentPkgJSON.name, dependentPkgJson, parentPkgJSON.name) await pushPatch(patchedPackageJSON, dependentRepositoryInfo.owner, dependentRepositoryInfo.name, parentPkgJSON.name, parentBranchName) - if (pullrequest) { + if (pullRequest) { await createPR(dependentRepositoryInfo.owner, dependentRepositoryInfo.name, parentBranchName, parentDependencyLink) } } diff --git a/test/cli/test.js b/test/cli/test.js index 0de0135..c1828b0 100644 --- a/test/cli/test.js +++ b/test/cli/test.js @@ -24,7 +24,7 @@ tap.test('test command', async (tap) => { }) tap.test('test command should call test module with dependent URI', async (tap) => { - const result = childProcess.execSync(`${wibyCommand} test --dependent="https://github.com/wiby-test/fakeRepo" --pullrequest=true`, { + const result = childProcess.execSync(`${wibyCommand} test --dependent="https://github.com/wiby-test/fakeRepo" --pull-request=true`, { env: { ...process.env, NODE_OPTIONS: `-r ${fixturesPath}/http/test-command-positive.js` diff --git a/test/config.js b/test/config.js index 264d5a4..3e9728d 100644 --- a/test/config.js +++ b/test/config.js @@ -39,7 +39,7 @@ tap.test('config validation', async (tap) => { repository: 'git+https://github.com/wiby-test/pass' } ], - pullrequest: false + pullRequest: false }) tap.end() })