(match)
| 295 | SomethingService2.Default |
| 296 | ], |
| 297 | *effect(match) { |
| 298 | const repo = yield* SomethingRepo |
| 299 | const smth = yield* SomethingService |
| 300 | const smth2 = yield* SomethingService2 |
| 301 | |
| 302 | // this gets catched in 'routes' type |
| 303 | if (Math.random() > 0.5) { |
| 304 | return yield* new InvalidStateError("ciao") |
| 305 | } |
| 306 | |
| 307 | console.log({ repo, smth, smth2 }) |
| 308 | |
| 309 | return match({ |
| 310 | Eff: () => |
| 311 | Effect |
| 312 | .gen(function*() { |
| 313 | const some = yield* Some |
| 314 | return yield* Effect.logInfo("Some", some) |
| 315 | }), |
| 316 | |
| 317 | *Gen() { |
| 318 | const some = yield* Some |
| 319 | return yield* Effect.logInfo("Some", some) |
| 320 | }, |
| 321 | *GetSomething(req) { |
| 322 | console.log(req["id"]) |
| 323 | |
| 324 | const _b = yield* Effect.succeed(false) |
| 325 | if (_b) { |
| 326 | // expected errors here because RequestError is not a valid error for controllers |
| 327 | // yield* new RequestError(1 as any) |
| 328 | // return yield* new RequestError(1 as any) |
| 329 | } |
| 330 | if (Math.random() > 0.5) { |
| 331 | return yield* Effect.succeed("12") |
| 332 | } |
| 333 | if (!_b) { |
| 334 | return yield* Effect.fail(new UnauthorizedError()) |
| 335 | } else { |
| 336 | // expected an error here because a boolean is not a string |
| 337 | // return _b |
| 338 | return "12" |
| 339 | } |
| 340 | }, |
| 341 | DoSomething: { |
| 342 | *raw() { |
| 343 | return yield* Effect.succeed(undefined) |
| 344 | } |
| 345 | }, |
| 346 | GetSomething2: { |
| 347 | raw: () => Some.use(() => Effect.succeed("12")) |
| 348 | } |
| 349 | }) |
| 350 | } |
| 351 | }) |
| 352 | |
| 353 | it("sorts based on requirements", () => { |
no test coverage detected
searching dependent graphs…