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');assert.throws(() => expectResult(TernaryResult.err('oops')), /needs value/u); Copy
const okValue = TernaryResult.ok('ready');assert.strictEqual(TernaryResult.expectToBe(okValue, 'missing'), 'ready');const expectResult = TernaryResult.expectToBe<string>('needs value');assert.throws(() => expectResult(TernaryResult.err('oops')), /needs value/u);
Unwraps the Ok value or throws with the provided message.