Skip to content

Commit dfb78bf

Browse files
committed
fix CI
1 parent 4f6f2da commit dfb78bf

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

packages/cli/src/commands/publish/__tests__/npm-utils.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ describe("getCorrectRegistry", () => {
4646
process.env["npm_config_@acme:registry"] =
4747
"https://registry.example.com/acme";
4848

49-
expect(
50-
getCorrectRegistry({ name: "@acme/pkg", version: "1.0.0" })
51-
).toEqual({
52-
scope: "@acme",
53-
registry: "https://registry.example.com/acme",
54-
});
49+
expect(getCorrectRegistry({ name: "@acme/pkg", version: "1.0.0" })).toEqual(
50+
{
51+
scope: "@acme",
52+
registry: "https://registry.example.com/acme",
53+
}
54+
);
5555
});
5656

5757
it("uses publishConfig.registry when provided", () => {
@@ -82,7 +82,9 @@ describe("getCorrectRegistry", () => {
8282
it("preserves registry URLs that already end with a slash", () => {
8383
process.env.npm_config_registry = "https://nexus.example.com/npm/";
8484

85-
expect(getCorrectRegistry().registry).toBe("https://nexus.example.com/npm/");
85+
expect(getCorrectRegistry().registry).toBe(
86+
"https://nexus.example.com/npm/"
87+
);
8688
});
8789

8890
it("preserves query params and hashes exactly", () => {

packages/cli/src/commands/publish/npm-utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export function getCorrectRegistry(packageJson?: PackageJSON): RegistryInfo {
7676

7777
return {
7878
scope: undefined,
79-
registry: !isCustomRegistry(registry) ? NPM_REGISTRY : registry,
79+
registry:
80+
!registry || !isCustomRegistry(registry) ? NPM_REGISTRY : registry,
8081
};
8182
}
8283

0 commit comments

Comments
 (0)