History

test(env): use @effect/vitest assertRight helper

Rhys Sullivan committed 7 months ago

Commit 474c0651 parent 895e5dd1 file · +5 −5Browse files

Unified · Split

packages/core/env/src/index.test.ts+5−5
@@ -1,4 +1,5 @@
11 import { describe, expect, it } from "@effect/vitest";
2+import { assertRight } from "@effect/vitest/utils";
23 import { Config, ConfigProvider, Effect } from "effect";
34
45 import { createEnv, Env, makeEnv } from "./index";
@@ -21,11 +22,10 @@ describe("makeEnv", () => { · 16 unmodified lines
2122 )(Effect.either(AppEnv.config)),
2223 );
2324
24− expect(parsed._tag).toBe("Right");
25− if (parsed._tag === "Right") {
26− expect(parsed.right.PORT).toBe(8080);
27− expect(parsed.right.HOST).toBe("0.0.0.0");
28− }
25+ assertRight(parsed, {
26+ PORT: 8080,
27+ HOST: "0.0.0.0",
28+ });
2929
3030 expect(AppEnv.Default).toBeDefined();
3131 });

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t