Unwraps the Ok value from a Result, or throws an error.
Ok
Result
The value which should be an Ok.
The unwrapped item.
expect(unwrap(ok(3))).toStrictEqual(3);expect(() => unwrap(err(4))).toThrowError("unwrapped Err"); Copy
expect(unwrap(ok(3))).toStrictEqual(3);expect(() => unwrap(err(4))).toThrowError("unwrapped Err");
Unwraps the
Okvalue from aResult, or throws an error.