GitHub
03/27/2024, 11:21 PMv0.4.19), but the clients will need to update their DSLs to support it.
Motivating Use Case
From a request in slack.
How might you write a matcher to check both the keys and values and the same time (use eachKeyMatches and eachValueMatches simultaneously):
enum Keys {
One = "One",
Two = "Two",
}
interface Value {
min: number
max: number
}
type R = Record<Keys, Value>
const record: R = {
[Keys.One]:
{
min: 1,
max: 2
}
}
it("check record", async () => {
messagePact
.expectsToReceive("record")
.withContent({
// What need to write here to check type R ?
})
})
Proposed API to support this
TBC
Background: pact-foundation/pact-reference#399 (comment)
pact-foundation/pact-js