describe('program', () => {
it('calls path.join', async () => {
const join = mock();
const layer = createTestPathLayer({ join });
await program.pipe(Effect.provide(layer), Effect.runPromise);
expect(join).toHaveBeenCalled();
});
});
const createTestPathLayer = (overrides?: Partial<Path.Path>) =>
Layer.effect(
Path.Path,
Effect.gen(function* () {
const path = yield* Path.Path;
return { ...path, ...overrides };
}).pipe(Effect.provide(Path.layer)),
);
describe('program', () => {
it('calls path.join', async () => {
const join = mock();
const layer = createTestPathLayer({ join });
await program.pipe(Effect.provide(layer), Effect.runPromise);
expect(join).toHaveBeenCalled();
});
});
const createTestPathLayer = (overrides?: Partial<Path.Path>) =>
Layer.effect(
Path.Path,
Effect.gen(function* () {
const path = yield* Path.Path;
return { ...path, ...overrides };
}).pipe(Effect.provide(Path.layer)),
);