Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("should accept a valid hero created message", (done) => {
messagePact
.expectsToReceive("a hero created message")
.withContent({
id: Matchers.like(42),
name: Matchers.like("Superman"),
superpower: Matchers.like("flying"),
universe: Matchers.term({generate: "DC", matcher: "^(DC|Marvel)$"})
})
.withMetadata({
"content-type": "application/json",
})
.verify(synchronousBodyHandler(HeroEventHandler.handleHeroCreatedEvent))
.then(() => done(), (error) => done(error));
}).timeout(5000);