forked from ProverCoderAI/docker-git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser-apply-all.test.ts
More file actions
34 lines (28 loc) · 1.1 KB
/
parser-apply-all.test.ts
File metadata and controls
34 lines (28 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { describe, expect, it } from "@effect/vitest"
import { Effect } from "effect"
import { parseOrThrow } from "./parser-helpers.js"
const assertApplyAllActiveOnly = (args: ReadonlyArray<string>, expectedActiveOnly: boolean) => {
const command = parseOrThrow(args)
expect(command._tag).toBe("ApplyAll")
if (command._tag === "ApplyAll") {
expect(command.activeOnly).toBe(expectedActiveOnly)
}
}
describe("parseArgs apply-all --active", () => {
it.effect("parses apply-all without --active as activeOnly=false", () =>
Effect.sync(() => {
assertApplyAllActiveOnly(["apply-all"], false)
}))
it.effect("parses update-all without --active as activeOnly=false", () =>
Effect.sync(() => {
assertApplyAllActiveOnly(["update-all"], false)
}))
it.effect("parses apply-all with --active as activeOnly=true", () =>
Effect.sync(() => {
assertApplyAllActiveOnly(["apply-all", "--active"], true)
}))
it.effect("parses update-all with --active as activeOnly=true", () =>
Effect.sync(() => {
assertApplyAllActiveOnly(["update-all", "--active"], true)
}))
})