Commit ab9a16dd authored by Will Cory's avatar Will Cory

test: Update error tests

parent f5758b1a
......@@ -565,24 +565,24 @@ describe('CrossChainMessenger', () => {
})
describe('when the transaction sent more than one message', () => {
it('should throw an error', async () => {
it('should not throw an error', async () => {
const messages = [...Array(2)].map(() => {
return DUMMY_MESSAGE
})
const tx = await l1Messenger.triggerSentMessageEvents(messages)
await expect(messenger.toCrossChainMessage(tx)).to.be.rejectedWith(
'expected 1 message, got 2'
)
await expect(
messenger.toCrossChainMessage(tx)
).not.to.be.rejectedWith('expected 1 message, got 2')
})
})
describe('when the transaction sent no messages', () => {
it('should throw an error', async () => {
it('should not throw an error', async () => {
const tx = await l1Messenger.triggerSentMessageEvents([])
await expect(messenger.toCrossChainMessage(tx)).to.be.rejectedWith(
'expected 1 message, got 0'
)
await expect(
messenger.toCrossChainMessage(tx)
).not.to.be.rejectedWith('expected 1 message, got 0')
})
})
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment