Skip to content

Commit

Permalink
revert minimum node version to 14, fix tests to work across node vers…
Browse files Browse the repository at this point in the history
…ions with differing error messages
  • Loading branch information
adonesky1 committed Aug 15, 2022
1 parent e480dfa commit f767905
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [16.8]
node-version: [14.x, 16.8]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"typescript": "^4.1.3"
},
"engines": {
"node": ">=16.0.0"
"node": ">=14.0.0"
},
"publishConfig": {
"access": "public",
Expand Down
22 changes: 11 additions & 11 deletions src/sign-typed-data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ describe('TypedDataUtils.encodeData', function () {
types,
SignTypedDataVersion.V3,
).toString('hex'),
).toThrow(`Cannot read property 'toArray' of null`);
).toThrow(`Cannot read`);
});

it('should encode data with an atomic property set to undefined', function () {
Expand Down Expand Up @@ -730,7 +730,7 @@ describe('TypedDataUtils.encodeData', function () {
types,
SignTypedDataVersion.V3,
).toString('hex'),
).toThrow(`Cannot read property 'name' of null`);
).toThrow(`Cannot read`);
});

it('should encode data with a custom type property set to undefined', function () {
Expand Down Expand Up @@ -1109,7 +1109,7 @@ describe('TypedDataUtils.encodeData', function () {
types,
SignTypedDataVersion.V4,
).toString('hex'),
).toThrow(`Cannot read property 'toArray' of null`);
).toThrow('Cannot read');
});

it('should throw an error when an atomic property is set to undefined', function () {
Expand Down Expand Up @@ -1938,7 +1938,7 @@ describe('TypedDataUtils.hashStruct', function () {
types,
SignTypedDataVersion.V3,
).toString('hex'),
).toThrow(`Cannot read property 'toArray' of null`);
).toThrow('Cannot read');
});

it('should hash data with an atomic property set to undefined', function () {
Expand Down Expand Up @@ -2077,7 +2077,7 @@ describe('TypedDataUtils.hashStruct', function () {
types,
SignTypedDataVersion.V3,
).toString('hex'),
).toThrow(`Cannot read property 'name' of null`);
).toThrow(`Cannot read`);
});

it('should hash data with a custom type property set to undefined', function () {
Expand Down Expand Up @@ -2456,7 +2456,7 @@ describe('TypedDataUtils.hashStruct', function () {
types,
SignTypedDataVersion.V4,
).toString('hex'),
).toThrow(`Cannot read property 'toArray' of null`);
).toThrow('Cannot read');
});

it('should throw an error when an atomic property is set to undefined', function () {
Expand Down Expand Up @@ -4354,7 +4354,7 @@ describe('typedSignatureHash', function () {
value: 'Hi, Alice!',
},
],
errorMessage: "Cannot read property 'startsWith' of undefined",
errorMessage: "Cannot read",
label: 'no type',
},
{
Expand Down Expand Up @@ -4474,7 +4474,7 @@ describe('signTypedData', function () {
data: [{ name: 'data', type: 'int32', value: null }],
version: SignTypedDataVersion.V1,
}),
).toThrow(`Cannot read property 'toArray' of null`);
).toThrow('Cannot read');
});

it('should sign data with an atomic property set to undefined', function () {
Expand Down Expand Up @@ -5093,7 +5093,7 @@ describe('signTypedData', function () {
},
version: SignTypedDataVersion.V3,
}),
).toThrow(`Cannot read property 'toArray' of null`);
).toThrow('Cannot read');
});

it('should sign data with an atomic property set to undefined', function () {
Expand Down Expand Up @@ -5252,7 +5252,7 @@ describe('signTypedData', function () {
},
version: SignTypedDataVersion.V3,
}),
).toThrow(`Cannot read property 'name' of null`);
).toThrow(`Cannot read`);
});

it('should sign data with a custom type property set to undefined', function () {
Expand Down Expand Up @@ -5963,7 +5963,7 @@ describe('signTypedData', function () {
},
version: SignTypedDataVersion.V4,
}),
).toThrow(`Cannot read property 'toArray' of null`);
).toThrow('Cannot read');
});

it('should throw an error when an atomic property is set to undefined', function () {
Expand Down

0 comments on commit f767905

Please sign in to comment.