Skip to content

Commit

Permalink
fix(npm-publish): Allows disabling of strict SSL checks (#2952)
Browse files Browse the repository at this point in the history
  • Loading branch information
10hendersonm committed Oct 9, 2022
1 parent 8a47a6d commit eec3207
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions utils/npm-publish/__tests__/npm-publish.test.js
Expand Up @@ -187,6 +187,23 @@ describe("npm-publish", () => {
expect(runLifecycle).toHaveBeenCalledTimes(2);
});

it.each([["true"], [true], ["false"], [false]])(
"aliases strict-ssl to strictSSL",
async (strictSSLValue) => {
const opts = { "strict-ssl": strictSSLValue };

await npmPublish(pkg, tarFilePath, opts);

expect(publish).toHaveBeenCalledWith(
expect.anything(),
expect.anything(),
expect.objectContaining({
strictSSL: strictSSLValue,
})
);
}
);

it("calls publish lifecycles", async () => {
const options = expect.objectContaining({
projectScope: "@scope",
Expand Down
2 changes: 2 additions & 0 deletions utils/npm-publish/npm-publish.js
Expand Up @@ -30,6 +30,8 @@ function flattenOptions(obj) {
// eslint-disable-next-line dot-notation -- (npm v7 compat)
defaultTag: obj["tag"] || "latest",
dryRun: obj["dry-run"],
// libnpmpublish / npm-registry-fetch check strictSSL rather than strict-ssl
strictSSL: obj["strict-ssl"],
...obj,
};
}
Expand Down

0 comments on commit eec3207

Please sign in to comment.