Skip to content

Commit

Permalink
fix: return false if the npm publish is skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdlg committed Dec 14, 2018
1 parent 2786cf2 commit 4a41228
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/publish.js
Expand Up @@ -41,4 +41,6 @@ module.exports = async ({npmPublish, pkgRoot}, pkg, context) => {
npmPublish === false ? 'npmPublish' : "package.json's private property"
} is ${npmPublish !== false}`
);

return false;
};
8 changes: 4 additions & 4 deletions test/integration.test.js
Expand Up @@ -333,7 +333,7 @@ test('Create the package and skip publish ("npmPublish" is false)', async t => {
}
);

t.falsy(result);
t.false(result);
t.is((await readJson(path.resolve(cwd, 'package.json'))).version, '1.0.0');
t.true(await pathExists(path.resolve(cwd, `tarball/${pkg.name}-1.0.0.tgz`)));
await t.throws(execa('npm', ['view', pkg.name, 'version'], {cwd, env: testEnv}));
Expand Down Expand Up @@ -363,7 +363,7 @@ test('Create the package and skip publish ("package.private" is true)', async t
}
);

t.falsy(result);
t.false(result);
t.is((await readJson(path.resolve(cwd, 'package.json'))).version, '1.0.0');
t.true(await pathExists(path.resolve(cwd, `tarball/${pkg.name}-1.0.0.tgz`)));
await t.throws(execa('npm', ['view', pkg.name, 'version'], {cwd, env: testEnv}));
Expand All @@ -388,7 +388,7 @@ test('Create the package and skip publish from a sub-directory ("npmPublish" is
}
);

t.falsy(result);
t.false(result);
t.is((await readJson(path.resolve(cwd, 'dist/package.json'))).version, '1.0.0');
t.true(await pathExists(path.resolve(cwd, `tarball/${pkg.name}-1.0.0.tgz`)));
await t.throws(execa('npm', ['view', pkg.name, 'version'], {cwd, env: testEnv}));
Expand Down Expand Up @@ -418,7 +418,7 @@ test('Create the package and skip publish from a sub-directory ("package.private
}
);

t.falsy(result);
t.false(result);
t.is((await readJson(path.resolve(cwd, 'dist/package.json'))).version, '1.0.0');
t.true(await pathExists(path.resolve(cwd, `tarball/${pkg.name}-1.0.0.tgz`)));
await t.throws(execa('npm', ['view', pkg.name, 'version'], {cwd, env: testEnv}));
Expand Down

0 comments on commit 4a41228

Please sign in to comment.