Skip to content

Commit

Permalink
BREAKING: Improve types and type validation (MetaMask#19)
Browse files Browse the repository at this point in the history
* Improve types and type validation

* Fix JsonRpcSuccess type

* Add functions to check if a value is a JsonRpcResponse

* Fix error message

* Add test vectors

* Move test.data to fixtures folder

* Improve error messages
  • Loading branch information
Mrtenz authored Aug 3, 2022
1 parent 08a783e commit 5cc6b38
Show file tree
Hide file tree
Showing 9 changed files with 1,188 additions and 372 deletions.
2 changes: 1 addition & 1 deletion merged-packages/utils/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
collectCoverage: true,
// Ensures that we collect coverage from all source files, not just tested
// ones.
collectCoverageFrom: ['./src/**/*.ts'],
collectCoverageFrom: ['./src/**/*.ts', '!./src/__fixtures__/**/*'],
coverageReporters: ['text', 'html'],
coverageThreshold: {
global: {
Expand Down
3 changes: 2 additions & 1 deletion merged-packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"docs:publish": "typedoc --cleanOutputDir false --gitRevision \"v$(jq -r .version < ./package.json)\""
},
"dependencies": {
"fast-deep-equal": "^3.1.3"
"fast-deep-equal": "^3.1.3",
"superstruct": "^0.16.0"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^1.0.5",
Expand Down
1 change: 1 addition & 0 deletions merged-packages/utils/src/__fixtures__/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './json';
Loading

0 comments on commit 5cc6b38

Please sign in to comment.