Skip to content

Commit 69c6427

Browse files
authoredMay 1, 2023
fix: handle missing latest tag during version check (#90)
Fixes #89
1 parent c08d30b commit 69c6427

27 files changed

+887
-651
lines changed
 

‎dist/main.js

+133-118
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/main.js.map

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"!__tests__"
3232
],
3333
"scripts": {
34-
"all": "npm run clean && npm run build && npm run lint && npm run coverage",
34+
"all": "npm run clean && npm run build && npm run format && npm run coverage",
3535
"clean": "rimraf coverage lib dist e2e/fixture *.tgz",
3636
"lint": "npm run _eslint && npm run _prettier -- --check",
3737
"format": "npm run _eslint -- --fix && npm run _prettier -- --write",

‎src/__tests__/format-publish-result.test.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import { describe, it, expect } from "vitest";
33
import * as subject from "../format-publish-result.js";
44
import type { PackageManifest } from "../read-manifest.js";
55
import type { NormalizedOptions } from "../normalize-options.js";
6+
import type { PublishResult } from "../compare-and-publish/index.js";
67

78
describe("formatPublishResult", () => {
89
it("should say if a publish was skipped", () => {
910
const result = subject.formatPublishResult(
1011
{ name: "cool-package", version: "1.2.3" } as PackageManifest,
11-
{} as NormalizedOptions
12+
{} as NormalizedOptions,
13+
{ id: undefined } as PublishResult
1214
);
1315

1416
expect(result).toMatch(/cool-package@1\.2\.3.+skipped/);
@@ -18,7 +20,10 @@ describe("formatPublishResult", () => {
1820
const result = subject.formatPublishResult(
1921
{ name: "cool-package", version: "1.2.3" } as PackageManifest,
2022
{ dryRun: { value: true } } as NormalizedOptions,
21-
{ id: "cool-package@1.2.3", files: [] }
23+
{
24+
id: "cool-package@1.2.3",
25+
files: [{ path: "cool-file-1", size: 1 }],
26+
} as PublishResult
2227
);
2328

2429
expect(result).toMatch(/cool-package@1\.2\.3.+DRY RUN/);
@@ -35,7 +40,7 @@ describe("formatPublishResult", () => {
3540
{ path: "cool-file-2", size: 1234 },
3641
{ path: "cool-file-3", size: 5_678_910 },
3742
],
38-
}
43+
} as PublishResult
3944
);
4045

4146
expect(result).not.toMatch(/DRY RUN/);

0 commit comments

Comments
 (0)
Failed to load comments.