In @0x/utils
: Add AnyRevertError
type that matches with any revert error
This commit is contained in:
committed by
Amir Bandeali
parent
abb71cd074
commit
703a0fde3c
@@ -1,6 +1,6 @@
|
||||
import * as chai from 'chai';
|
||||
|
||||
import { RevertError, StringRevertError } from '../src/revert_error';
|
||||
import { AnyRevertError, RevertError, StringRevertError } from '../src/revert_error';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
|
||||
@@ -35,6 +35,11 @@ describe('RevertError', () => {
|
||||
const revert2 = new StringRevertError();
|
||||
expect(revert1.equals(revert2)).to.be.true();
|
||||
});
|
||||
it('should equate AnyRevertError with a real RevertError', () => {
|
||||
const revert1 = new StringRevertError(message);
|
||||
const revert2 = new AnyRevertError();
|
||||
expect(revert1.equals(revert2)).to.be.true();
|
||||
});
|
||||
it('should not equate a the same RevertError type with different values', () => {
|
||||
const revert1 = new StringRevertError(message);
|
||||
const revert2 = new StringRevertError(`${message}1`);
|
||||
|
Reference in New Issue
Block a user