GitHub
10/04/2023, 1:31 PMnpm run dist works locally (this will run tests, lint and build)
☑︎ Commit messages are ready to go in the changelog (see below for details)
☑︎ PR template filled in (see below for details)
Summary
This PR fixes the stateHandlers property on VerifierOptions by making the stateHandlers on MessageStateHandlers a generic type, which is set as unknown in the MessageProviderOptions type.
This issue is described in #1057, and marked as fixed in #1062, but the type issue still persists in v`12.1.0`
When using the following:
stateHandlers: {
'some state': {
setup: async () => {},
teardown: async () => {},
}
}
The following TS error is present
Type '{ setup: () => Promise<void>; teardown: () => Promise<void>; }' provides no match for the signature '(state: string, params?: { [name: string]: string; } | undefined): Promise<unknown>'.ts
image▾
MessageStateHandlers is exposed.
Would love to know if there's a better way to do this!
pact-foundation/pact-js
Cirrus CI: macos_arm NODE_VERSION:18
Cirrus CI: macos_arm NODE_VERSION:16
Cirrus CI: linux_arm arm_containernode18-slim
Cirrus CI: linux_arm arm_containernode16-slim
Cirrus CI: macos_arm NODE_VERSION:20
Cirrus CI: linux_arm arm_containernode20.2-slim
✅ 1 other check has passed
1/7 successful checksGitHub
10/04/2023, 2:21 PM