const okValue = TernaryResult.ok('ready');
assert.strictEqual(TernaryResult.expectToBe(okValue, 'missing'), 'ready');
const expectResult = TernaryResult.expectToBe<string>('needs value');
const throwTest = (): void => {
expectResult(TernaryResult.err('oops'));
};
assert.throws(throwTest, /needs value/u);
Unwraps the Ok value or throws with the provided message.
const okValue = TernaryResult.ok('ready');
assert.strictEqual(TernaryResult.expectToBe(okValue, 'missing'), 'ready');
const expectResult = TernaryResult.expectToBe<string>('needs value');
const throwTest = (): void => {
expectResult(TernaryResult.err('oops'));
};
assert.throws(throwTest, /needs value/u);
Unwraps the Ok value or throws with the provided message.