diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-27 10:00:05 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:11 +0800 |
commit | 2e79ce26cbeacdeb0ea52b7c2e3da68e8055e7c6 (patch) | |
tree | 4c1cceafe09a3b659c3fb7da8d178dd39712dd53 /packages/utils/test/abi_encoder/return_values_test.ts | |
parent | ad1b5af4e59ba750c019cab1f5ec9584b8645101 (diff) | |
download | dexon-0x-contracts-2e79ce26cbeacdeb0ea52b7c2e3da68e8055e7c6.tar dexon-0x-contracts-2e79ce26cbeacdeb0ea52b7c2e3da68e8055e7c6.tar.gz dexon-0x-contracts-2e79ce26cbeacdeb0ea52b7c2e3da68e8055e7c6.tar.bz2 dexon-0x-contracts-2e79ce26cbeacdeb0ea52b7c2e3da68e8055e7c6.tar.lz dexon-0x-contracts-2e79ce26cbeacdeb0ea52b7c2e3da68e8055e7c6.tar.xz dexon-0x-contracts-2e79ce26cbeacdeb0ea52b7c2e3da68e8055e7c6.tar.zst dexon-0x-contracts-2e79ce26cbeacdeb0ea52b7c2e3da68e8055e7c6.zip |
Tests use to.be.deep.equal instead of JSON
Diffstat (limited to 'packages/utils/test/abi_encoder/return_values_test.ts')
-rw-r--r-- | packages/utils/test/abi_encoder/return_values_test.ts | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/packages/utils/test/abi_encoder/return_values_test.ts b/packages/utils/test/abi_encoder/return_values_test.ts index 850cb1746..3215509f1 100644 --- a/packages/utils/test/abi_encoder/return_values_test.ts +++ b/packages/utils/test/abi_encoder/return_values_test.ts @@ -16,9 +16,7 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const returnValue = '0x'; const decodedReturnValue = method.decodeReturnValues(returnValue); const expectedDecodedReturnValue: any[] = []; - const decodedReturnValueJson = JSON.stringify(decodedReturnValue); - const expectedDecodedReturnValueJson = JSON.stringify(expectedDecodedReturnValue); - expect(decodedReturnValueJson).to.be.equal(expectedDecodedReturnValueJson); + expect(decodedReturnValue).to.be.deep.equal(expectedDecodedReturnValue); }); it('Single static return value', async () => { // Generate Return Value @@ -27,9 +25,7 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const encodedReturnValue = method.encodeReturnValues(returnValue); const decodedReturnValue = method.decodeReturnValues(encodedReturnValue); // Validate decoded return value - const decodedReturnValueJson = JSON.stringify(decodedReturnValue); - const expectedDecodedReturnValueJson = JSON.stringify(returnValue); - expect(decodedReturnValueJson).to.be.equal(expectedDecodedReturnValueJson); + expect(decodedReturnValue).to.be.deep.equal(returnValue); }); it('Multiple static return values', async () => { // Generate Return Value @@ -38,9 +34,7 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const encodedReturnValue = method.encodeReturnValues(returnValue); const decodedReturnValue = method.decodeReturnValues(encodedReturnValue); // Validate decoded return value - const decodedReturnValueJson = JSON.stringify(decodedReturnValue); - const expectedDecodedReturnValueJson = JSON.stringify(returnValue); - expect(decodedReturnValueJson).to.be.equal(expectedDecodedReturnValueJson); + expect(decodedReturnValue).to.be.deep.equal(returnValue); }); it('Single dynamic return value', async () => { // Generate Return Value @@ -49,9 +43,7 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const encodedReturnValue = method.encodeReturnValues(returnValue); const decodedReturnValue = method.decodeReturnValues(encodedReturnValue); // Validate decoded return value - const decodedReturnValueJson = JSON.stringify(decodedReturnValue); - const expectedDecodedReturnValueJson = JSON.stringify(returnValue); - expect(decodedReturnValueJson).to.be.equal(expectedDecodedReturnValueJson); + expect(decodedReturnValue).to.be.deep.equal(returnValue); }); it('Multiple dynamic return values', async () => { // Generate Return Value @@ -60,9 +52,7 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const encodedReturnValue = method.encodeReturnValues(returnValue); const decodedReturnValue = method.decodeReturnValues(encodedReturnValue); // Validate decoded return value - const decodedReturnValueJson = JSON.stringify(decodedReturnValue); - const expectedDecodedReturnValueJson = JSON.stringify(returnValue); - expect(decodedReturnValueJson).to.be.equal(expectedDecodedReturnValueJson); + expect(decodedReturnValue).to.be.deep.equal(returnValue); }); it('Mixed static/dynamic return values', async () => { // Generate Return Value @@ -71,8 +61,6 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const encodedReturnValue = method.encodeReturnValues(returnValue); const decodedReturnValue = method.decodeReturnValues(encodedReturnValue); // Validate decoded return value - const decodedReturnValueJson = JSON.stringify(decodedReturnValue); - const expectedDecodedReturnValueJson = JSON.stringify(returnValue); - expect(decodedReturnValueJson).to.be.equal(expectedDecodedReturnValueJson); + expect(decodedReturnValue).to.be.deep.equal(returnValue); }); }); |