code quality

This commit is contained in:
2026-01-26 11:02:19 +01:00
parent afef777961
commit f877f821ef
14 changed files with 232 additions and 87 deletions

View File

@@ -294,11 +294,11 @@ describe('Result', () => {
it('should stop chaining on first error', () => {
const result = Result.ok(2)
.andThen((x) => Result.ok(x * 3))
.andThen((x) => Result.err(new Error(`stopped at ${x}`)))
.andThen((x) => Result.err<number, Error>(new Error(`stopped at ${x}`)))
.andThen((x) => Result.ok(x + 1)); // This should not execute
expect(result.isErr()).toBe(true);
expect(result.unwrapErr().message).toBe('stopped here');
expect(result.unwrapErr().message).toBe('stopped at 6');
});
});