pact-js消息使用者合同示例不起作用

问题描述 投票:0回答:1

我想开始使用Pact为我们的异步消息流体系结构启用“消费者驱动的合同”。通过pact-foundation阅读了大多数文档和入门指南之后,我尝试按照https://github.com/pact-foundation/pact-js/tree/master/examples/messages中的示例进行操作。现在,我只需要Pact创建的消费者方。

我跑步时

npm i
npm run test:consumer

我在debug级别收到以下错误:

[2020-04-02T09:30:19.822Z]  INFO: [email protected]/15568 on MYPC: Verifying message
[2020-04-02T09:30:19.829Z]  INFO: [email protected]/15568 on MYPC: Creating Message
[2020-04-02T09:30:19.839Z]  INFO: [email protected]/15568 on MYPC: Creating message pact
[2020-04-02T09:30:19.849Z] DEBUG: [email protected]/15568 on MYPC: Starting pact binary 'standalone\win32-1.82.1\pact\bin\pact-message.bat', with arguments ...
[2020-04-02T09:30:19.922Z] DEBUG: [email protected]/15568 on MYPC: Created 'standalone\win32-1.82.1\pact\bin\pact-message.bat' process with PID: 20196
[2020-04-02T09:30:20.000Z] DEBUG: [email protected]/15568 on MYPC:
    The filename, directory name, or volume label syntax is incorrect.

然后我一直跟踪到.verify(synchronousBodyHandler(dogApiHandler))message-consumer.spec.ts内部,最终导致class Spawn驻留在pact-foundation的pact-node存储库中的spawn.ts中。

为了正确调用契约创建逻辑的示例,我必须更改package.json文件:

"test:consumer": "nyc --check-coverage --reporter=html --reporter=text-summary mocha consumer/*.spec.ts"

to

"test:consumer": "nyc --check-coverage --reporter=html --reporter=text-summary ts-mocha consumer/*.spec.ts"

我的想法不多了,因为我的javascript / node.js / typescript技能非常有限。将不胜感激。谢谢,干杯pypapo

node.js pact pact-node
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.