diff --git a/test/integration/contract.js b/test/integration/contract.js index 65449b0d47..eb0b836c27 100644 --- a/test/integration/contract.js +++ b/test/integration/contract.js @@ -431,7 +431,7 @@ describe('Contract', function () { try { await contract.contractCompile(contractWithLib) } catch (e) { - e.message.indexOf('Couldn\'t find include file').should.not.be.equal(-1) + e.message.should.include('Couldn\'t find include file') } }) it('Can deploy contract with external deps', async () => { @@ -447,7 +447,7 @@ describe('Contract', function () { deployedStatic.result.should.have.property('returnType') const encodedCallData = await compiled.encodeCall('sumNumbers', ['1', '2']) - encodedCallData.indexOf('cb_').should.not.be.equal(-1) + encodedCallData.should.satisfy(s => s.startsWith('cb_')) }) it('Can call contract with external deps', async () => { const callResult = await deployed.call('sumNumbers', ['1', '2']) @@ -471,7 +471,7 @@ describe('Contract', function () { compiler.compilerVersion = '1.0.0' await compiler.checkCompatibility() } catch (e) { - e.message.indexOf('Unsupported compiler version 1.0.0').should.not.be.equal(-1) + e.message.should.satisfy(s => s.startsWith('Unsupported compiler version 1.0.0')) } }) it('compile', async () => { @@ -997,8 +997,7 @@ describe('Contract', function () { try { await contractObject.methods.hashFn(decoded) } catch (e) { - const isSizeCheck = e.message.indexOf('not a 32 bytes') !== -1 - isSizeCheck.should.be.equal(true) + e.message.should.include('not a 32 bytes') } }) it('Valid', async () => { @@ -1024,8 +1023,7 @@ describe('Contract', function () { try { await contractObject.methods.signatureFn(decoded) } catch (e) { - const isSizeCheck = e.message.indexOf('not a 64 bytes') !== -1 - isSizeCheck.should.be.equal(true) + e.message.should.include('not a 64 bytes') } }) it('Valid', async () => { @@ -1052,8 +1050,7 @@ describe('Contract', function () { try { await contractObject.methods.bytesFn(Buffer.from([...decoded, 2])) } catch (e) { - const isSizeCheck = e.message.indexOf('not a 32 bytes') !== -1 - isSizeCheck.should.be.equal(true) + e.message.should.include('not a 32 bytes') } }) it('Valid', async () => {