Skip to content

Commit

Permalink
fix: fix plugin name for checking other step config
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdlg committed Mar 7, 2018
1 parent 338d3e6 commit e88771e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ async function verifyConditions(pluginConfig, params) {
if (PLUGIN_TYPES.includes(option)) {
for (const plugin of castArray(value)) {
if (
plugin === '@semantic-release/script' ||
(isPlainObject(plugin) && plugin.path === '@semantic-release/script')
plugin === '@semantic-release/exec' ||
(isPlainObject(plugin) && plugin.path === '@semantic-release/exec')
) {
verifyConfig(plugin);
}
Expand Down
8 changes: 4 additions & 4 deletions test/verify-confitions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ test.serial('Throw "SemanticReleaseError" if "cmd" options is empty', async t =>
t.is(error.code, 'EINVALIDCMD');
});

test.serial('Throw "SemanticReleaseError" if another script plugin "cmd" options is missing', async t => {
test.serial('Throw "SemanticReleaseError" if another exec plugin "cmd" options is missing', async t => {
const pluginConfig = {cmd: './test/fixtures/echo-args.sh'};
const params = {
logger: t.context.logger,
options: {publish: ['@semantic-release/npm', {path: '@semantic-release/script'}]},
options: {publish: ['@semantic-release/npm', {path: '@semantic-release/exec'}]},
};

const error = await t.throws(verifyConditions(pluginConfig, params));
Expand All @@ -53,13 +53,13 @@ test.serial('Throw "SemanticReleaseError" if another script plugin "cmd" options
t.is(error.code, 'EINVALIDCMD');
});

test.serial('Throw "SemanticReleaseError" if another script plugin "cmd" options is empty', async t => {
test.serial('Throw "SemanticReleaseError" if another exec plugin "cmd" options is empty', async t => {
const pluginConfig = {cmd: './test/fixtures/echo-args.sh'};
const params = {
logger: t.context.logger,
options: {
branch: 'master',
publish: ['@semantic-release/npm', {path: '@semantic-release/script', cmd: ' '}],
publish: ['@semantic-release/npm', {path: '@semantic-release/exec', cmd: ' '}],
},
};

Expand Down

0 comments on commit e88771e

Please sign in to comment.