Skip to content

Commit

Permalink
fix: handle missing latest tag during version check (#90)
Browse files Browse the repository at this point in the history
Fixes #89
  • Loading branch information
mcous authored May 1, 2023
1 parent c08d30b commit 69c6427
Show file tree
Hide file tree
Showing 27 changed files with 887 additions and 651 deletions.
251 changes: 133 additions & 118 deletions dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"!__tests__"
],
"scripts": {
"all": "npm run clean && npm run build && npm run lint && npm run coverage",
"all": "npm run clean && npm run build && npm run format && npm run coverage",
"clean": "rimraf coverage lib dist e2e/fixture *.tgz",
"lint": "npm run _eslint && npm run _prettier -- --check",
"format": "npm run _eslint -- --fix && npm run _prettier -- --write",
Expand Down
11 changes: 8 additions & 3 deletions src/__tests__/format-publish-result.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { describe, it, expect } from "vitest";
import * as subject from "../format-publish-result.js";
import type { PackageManifest } from "../read-manifest.js";
import type { NormalizedOptions } from "../normalize-options.js";
import type { PublishResult } from "../compare-and-publish/index.js";

describe("formatPublishResult", () => {
it("should say if a publish was skipped", () => {
const result = subject.formatPublishResult(
{ name: "cool-package", version: "1.2.3" } as PackageManifest,
{} as NormalizedOptions
{} as NormalizedOptions,
{ id: undefined } as PublishResult
);

expect(result).toMatch(/cool-package@1\.2\.3.+skipped/);
Expand All @@ -18,7 +20,10 @@ describe("formatPublishResult", () => {
const result = subject.formatPublishResult(
{ name: "cool-package", version: "1.2.3" } as PackageManifest,
{ dryRun: { value: true } } as NormalizedOptions,
{ id: "[email protected]", files: [] }
{
id: "[email protected]",
files: [{ path: "cool-file-1", size: 1 }],
} as PublishResult
);

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

expect(result).not.toMatch(/DRY RUN/);
Expand Down
Loading

0 comments on commit 69c6427

Please sign in to comment.