Skip to content

Commit

Permalink
test(cli): improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed Jul 29, 2024
1 parent 13f76b0 commit a282ab6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cli/fixtures/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"imports": {
"std/": "https://deno.land/std@0.222.0/",
"@luca/flag": "jsr:@luca/flag@^1.0.0",
"@conventional-commits/parser": "npm:@conventional-commits/parser@^0.4.0"
"@conventional-commits/parser": "npm:@conventional-commits/parser@^0.3.0"
}
}
12 changes: 9 additions & 3 deletions cli/fixtures/deno.lock

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

2 changes: 1 addition & 1 deletion cli/fixtures/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import "https://deno.land/std@0.222.0/bytes/copy.ts";
import "jsr:@luca/flag@1.0.0";
import "npm:@conventional-commits/parser@0.4.0";
import "npm:@conventional-commits/parser@0.3.0";
19 changes: 10 additions & 9 deletions cli/main_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("CLI", () => {
assertEquals(
stdout,
dedent`
πŸ“¦ @conventional-commits/parser 0.4.0 β†’ 0.4.1
πŸ“¦ @conventional-commits/parser 0.3.0 β†’ 0.4.1 (^0.3.0 β†’ ^0.4.0)
πŸ“¦ @luca/flag 1.0.0 β†’ 1.0.1
πŸ“¦ deno.land/std 0.222.0 β†’ 0.224.0
`,
Expand All @@ -54,7 +54,7 @@ describe("CLI", () => {
assertEquals(
stdout,
dedent`
πŸ“¦ @conventional-commits/parser 0.4.0 β†’ 0.4.1
πŸ“¦ @conventional-commits/parser 0.3.0 β†’ 0.4.1 (^0.3.0 β†’ ^0.4.0)
πŸ“¦ @luca/flag 1.0.0 β†’ 1.0.1
πŸ“¦ deno.land/std 0.222.0 β†’ 0.224.0
`,
Expand All @@ -74,7 +74,7 @@ describe("CLI", () => {
assertEquals(
stdout,
dedent`
πŸ“¦ @conventional-commits/parser 0.4.0 β†’ 0.4.1
πŸ“¦ @conventional-commits/parser 0.3.0 β†’ 0.4.1 (^0.3.0 β†’ ^0.4.0)
πŸ“¦ @luca/flag 1.0.0 β†’ 1.0.1
πŸ“¦ deno.land/std 0.222.0 β†’ 0.224.0
`,
Expand All @@ -96,18 +96,19 @@ describe("CLI", () => {
assertEquals(
stdout,
dedent`
πŸ“¦ @conventional-commits/parser 0.4.0 β†’ 0.4.1
πŸ“¦ @conventional-commits/parser 0.3.0 β†’ 0.4.1 (^0.3.0 β†’ ^0.4.0)
πŸ“¦ @luca/flag 1.0.0 β†’ 1.0.1
πŸ“¦ deno.land/std 0.222.0 β†’ 0.224.0
`,
);
});

it("should only find updates to non-ranged deps with `--no-lock`", async () => {
it("should only find updates to constraints with `--no-lock`", async () => {
const { stdout } = await molt("--no-lock");
assertEquals(
stdout,
dedent`
πŸ“¦ @conventional-commits/parser ^0.3.0 β†’ ^0.4.0
πŸ“¦ deno.land/std 0.222.0 β†’ 0.224.0
`,
);
Expand All @@ -128,7 +129,7 @@ describe("CLI", () => {
assertEquals(
stdout,
dedent`
πŸ“¦ @conventional-commits/parser 0.4.0 β†’ 0.4.1
πŸ“¦ @conventional-commits/parser 0.3.0 β†’ 0.4.1 (^0.3.0 β†’ ^0.4.0)
πŸ“¦ deno.land/std 0.222.0 β†’ 0.224.0
`,
);
Expand All @@ -139,7 +140,7 @@ describe("CLI", () => {
assertEquals(
stdout,
dedent`
πŸ“¦ @conventional-commits/parser 0.4.0 β†’ 0.4.1
πŸ“¦ @conventional-commits/parser 0.3.0 β†’ 0.4.1
πŸ“¦ @luca/flag 1.0.0 β†’ 1.0.1
πŸ“¦ deno.land/std 0.222.0 β†’ 0.224.0
`,
Expand All @@ -151,7 +152,7 @@ describe("CLI", () => {
assertEquals(
stdout,
dedent`
πŸ“¦ @conventional-commits/parser 0.4.0 β†’ 0.4.1
πŸ“¦ @conventional-commits/parser 0.3.0 β†’ 0.4.1
πŸ“¦ @luca/flag 1.0.0 β†’ 1.0.1
πŸ“¦ deno.land/std 0.222.0 β†’ 0.224.0
`,
Expand All @@ -163,7 +164,7 @@ describe("CLI", () => {
assertEquals(
stdout,
dedent`
πŸ“¦ @conventional-commits/parser 0.4.0 β†’ 0.4.1
πŸ“¦ @conventional-commits/parser 0.3.0 β†’ 0.4.1
πŸ“¦ @luca/flag 1.0.0 β†’ 1.0.1
πŸ“¦ deno.land/std 0.222.0 β†’ 0.224.0
`,
Expand Down

0 comments on commit a282ab6

Please sign in to comment.