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 @@
1import { describe, expect, it } from "@effect/vitest";1import { describe, expect, it } from "@effect/vitest";
2import { assertRight } from "@effect/vitest/utils";
2import { Config, ConfigProvider, Effect } from "effect";3import { Config, ConfigProvider, Effect } from "effect";
3 4
4import { createEnv, Env, makeEnv } from "./index";5import { createEnv, Env, makeEnv } from "./index";
@@ -21,11 +22,10 @@ describe("makeEnv", () => { · 16 unmodified lines
21 )(Effect.either(AppEnv.config)),22 )(Effect.either(AppEnv.config)),
22 );23 );
23 24
24 expect(parsed._tag).toBe("Right");25 assertRight(parsed, {
25 if (parsed._tag === "Right") {26 PORT: 8080,
26 expect(parsed.right.PORT).toBe(8080);27 HOST: "0.0.0.0",
27 expect(parsed.right.HOST).toBe("0.0.0.0");28 });
28 }
29 29
30 expect(AppEnv.Default).toBeDefined();30 expect(AppEnv.Default).toBeDefined();
31 });31 });

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