From 9d75a72a02487e9c43d76a9b0f633c0cdfdefd60 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 20 Feb 2019 17:59:53 -0800 Subject: [PATCH] Add back test --- packages/assert/test/assert_test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/assert/test/assert_test.ts b/packages/assert/test/assert_test.ts index 4f67871032..9266496ac0 100644 --- a/packages/assert/test/assert_test.ts +++ b/packages/assert/test/assert_test.ts @@ -154,6 +154,18 @@ describe('Assertions', () => { invalidInputs.forEach(input => expect(assert.isBoolean.bind(assert, variableName, input)).to.throw()); }); }); + describe('#isWeb3Provider', () => { + it('should not throw for valid input', () => { + const validInputs = [{ send: () => 45 }, { sendAsync: () => 45 }]; + validInputs.forEach(input => + expect(assert.isWeb3Provider.bind(assert, variableName, input)).to.not.throw(), + ); + }); + it('should throw for invalid input', () => { + const invalidInputs = [42, { random: 'test' }, undefined, new BigNumber(45)]; + invalidInputs.forEach(input => expect(assert.isWeb3Provider.bind(assert, variableName, input)).to.throw()); + }); + }); describe('#doesConformToSchema', () => { const schema = schemas.addressSchema; it('should not throw for valid input', () => {