Skip to content

Commit

Permalink
Use ternary shorthand
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Jul 18, 2024
1 parent 81e6eef commit d9bd4a6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/unit/scval_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,9 @@ describe('parsing and building ScVals', function () {
it('lets strings be small integer ScVals', function () {
['i32', 'u32'].forEach((type) => {
const scv = nativeToScVal('12345', { type });
if (type === 'u32') {
expect(scv.switch()).to.eql(xdr.ScValType.scvU32());
} else {
expect(scv.switch()).to.eql(xdr.ScValType.scvI32());
}
expect(scv.switch()).to.eql(
type === 'u32' ? xdr.ScValType.scvU32() : xdr.ScValType.scvI32()
);
expect(scv.value()).to.eql(12345);
});
});
Expand Down

0 comments on commit d9bd4a6

Please sign in to comment.