Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | import os from 'node:os'; |
| 2 | import { describe, expect, it } from '@effect/vitest'; |
| 3 | import { Effect } from 'effect'; |
| 4 | import { defaultNodeOs, NodeOs } from 'src/services/node-os'; |
| 5 | |
| 6 | describe('NodeOs', () => { |
| 7 | it.effect('exposes operating-system details through an Effect service', () => |
| 8 | Effect.gen(function* () { |
| 9 | const nodeOs = yield* NodeOs; |
| 10 | |
| 11 | expect(nodeOs).toMatchObject({ |
| 12 | homedir: os.homedir(), |
| 13 | tmpdir: os.tmpdir(), |
| 14 | platform: os.platform(), |
| 15 | arch: os.arch(), |
| 16 | }); |
| 17 | }).pipe(Effect.provide(NodeOs.Default)) |
| 18 | ); |
| 19 | |
| 20 | it('supports deterministic home and temporary directories in tests', () => { |
| 21 | expect( |
| 22 | defaultNodeOs({ |
| 23 | homedir: '/test/home', |
| 24 | tmpdir: '/test/tmp', |
| 25 | }) |
| 26 | ).toMatchObject({ |
| 27 | homedir: '/test/home', |
| 28 | tmpdir: '/test/tmp', |
| 29 | platform: os.platform(), |
| 30 | arch: os.arch(), |
| 31 | }); |
| 32 | }); |
| 33 | }); |