Skip to content

Commit

Permalink
fix: remove tsd
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptodev-2s committed Jun 20, 2024
1 parent dc2f57b commit c99a02c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 395 deletions.
3 changes: 1 addition & 2 deletions constraints.pro
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ gen_enforced_field(WorkspaceCwd, 'scripts.changelog:update', CorrectChangelogUpd

% All non-root packages must have the same "test" script.
gen_enforced_field(WorkspaceCwd, 'scripts.test', 'jest --reporters=jest-silent-reporter') :-
WorkspaceCwd \= '.',
\+ workspace_field(WorkspaceCwd, 'name', '@metamask/eth-json-rpc-provider').
WorkspaceCwd \= '.'.

% All non-root packages must have the same "test:clean" script.
gen_enforced_field(WorkspaceCwd, 'scripts.test:clean', 'jest --clearCache') :-
Expand Down
8 changes: 1 addition & 7 deletions packages/eth-json-rpc-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn lint:dependencies",
"lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern",
"publish:preview": "yarn npm publish --tag preview",
"test": "yarn test:source && yarn test:types",
"test": "jest --reporters=jest-silent-reporter",
"test:clean": "jest --clearCache",
"test:source": "jest --reporters=jest-silent-reporter",
"test:types": "tsd",
"test:verbose": "jest --verbose",
"test:watch": "jest --watch"
},
Expand All @@ -63,7 +61,6 @@
"jest": "^27.5.1",
"jest-it-up": "^2.0.2",
"ts-jest": "^27.1.4",
"tsd": "^0.29.0",
"typedoc": "^0.24.8",
"typescript": "~4.9.5",
"uuid": "^8.3.2"
Expand All @@ -80,8 +77,5 @@
"allowScripts": {
"@lavamoat/preinstall-always-fail": false
}
},
"tsd": {
"directory": "src"
}
}

This file was deleted.

14 changes: 7 additions & 7 deletions tests/fake-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ export type FakeProviderResponse = { result: any } | { error: string };

/**
* An object that allows specifying the behavior of a specific invocation of
* `sendAsync`. The `method` always identifies the stub, but the behavior
* may be specified multiple ways: `sendAsync` can either return a promise or
* `request`. The `method` always identifies the stub, but the behavior
* may be specified multiple ways: `request` can either return a promise or
* throw an error, and if it returns a promise, that promise can either be
* resolved with a response object or reject with an error.
*
* @property request - Looks for a request matching these specifications.
* @property request.method - The RPC method to which this stub will be matched.
* @property request.params - The params to which this stub will be matched.
* @property response - Instructs `sendAsync` to return a promise that resolves
* @property response - Instructs `request` to return a promise that resolves
* with a response object.
* @property response.result - Specifies a successful response, with this as the
* `result`.
* @property response.error - Specifies an error response, with this as the
* `error`.
* @property error - Instructs `sendAsync` to return a promise that rejects with
* @property error - Instructs `request` to return a promise that rejects with
* this error.
* @property implementation - Allows overriding `sendAsync` entirely. Useful if
* @property implementation - Allows overriding `request` entirely. Useful if
* you want it to throw an error.
* @property delay - The amount of time that will pass after the callback is
* called with the response.
Expand Down Expand Up @@ -72,7 +72,7 @@ export type FakeProviderStub = {
* The set of options that the FakeProvider constructor takes.
*
* @property stubs - A set of objects that allow specifying the behavior
* of specific invocations of `sendAsync` matching a `method`.
* of specific invocations of `request` matching a `method`.
*/
type FakeProviderEngineOptions = {
stubs?: FakeProviderStub[];
Expand Down Expand Up @@ -101,7 +101,7 @@ export class FakeProvider extends SafeEventEmitterProvider {
*
* @param options - The options.
* @param options.stubs - A set of objects that allow specifying the behavior
* of specific invocations of `sendAsync` matching a `method`.
* of specific invocations of `request` matching a `method`.
*/
constructor({ stubs = [] }: FakeProviderEngineOptions = {}) {
super({ engine: new JsonRpcEngine() });
Expand Down
Loading

0 comments on commit c99a02c

Please sign in to comment.