consumer@1.0.0 pacts C:\UIEN-Local\pact-test\pact-...
# pact-js
consumer@1.0.0 pacts C:\UIEN-Local\pact-test\pact-test
mocha --recursive "tests/*.pact.js" --timeout 100000
[2022-03-30T220407.287Z] INFO: pact-node@10.9.4/13532 on PC0X2B10: Creating Pact Server with options: {"consumer":"React","cors":false,"dir":"C:\\UIEN-Local\\pact-test\\pact-test\\pacts","host":"","log":"C:\\UIEN-Local\\pact-test\\pact-test\\logs\\pact.log","pactFileWriteMode":"overwrite","port":1234,"provider":"token","spec":2,"ssl":false} Consumer Test [2022-03-30T220408.891Z] INFO: pact@9.11.0/13532 on PC0X2B10: Setting up Pact with Consumer "React" and Provider "token" using mock service on Port: "1234" √ OK response Pact verification failed! Actual interactions do not match expected interactions for mock MockService. Missing requests: GET /modules See C:/UIEN-Local/pact-test/pact-test/logs/pact.log for details. (node:13532) UnhandledPromiseRejectionWarning: AssertionError: expected 'OK ' to equal 'OK' at C\UIEN Local\pact test\pact test\tests\consumer.pact.js55:47 at processTicksAndRejections (internal/process/task_queues.js975) (node:13532) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
(see (rejection id: 2) (node:13532) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. 1) "after each" hook for "OK response" [2022-03-30T220408.973Z] INFO: pact@9.11.0/13532 on PC0X2B10: Pact File Written [2022-03-30T220408.973Z] INFO: pact-node@10.9.4/13532 on PC0X2B10: Removing Pact process with PID: 9936 [2022-03-30T220409.152Z] INFO: pact-node@10.9.4/13532 on PC0X2B10: Deleting Pact Server with options: {"consumer":"React","cors":false,"dir":"C:\\UIEN-Local\\pact-test\\pact-test\\pacts","host":"","log":"C:\\UIEN-Local\\pact-test\\pact-test\\logs\\pact.log","pactFileWriteMode":"overwrite","port":1234,"provider":"token","spec":2,"ssl":false} 1 passing (2s) 1 failing 1) Consumer Test "after each" hook for "OK response": Error: Pact verification failed - expected interactions did not match actual. at new VerificationError (node_modules\@pact-foundation\pact\errors\verificationError.js1942) at C:\UIEN-Local\pact-test\pact-test\node_modules\@pact-foundation\pact\httpPact.js10223 at processTicksAndRejections (internal/process/task_queues.js975) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! consumer@1.0.0 pacts:
mocha --recursive "tests/*.pact.js" --timeout 100000
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the consumer@1.0.0 pacts script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\radha.danthuluri\AppData\Roaming\npm-cache\_logs\2022-03-30T22_04_09_197Z-debug.log
9 times out of ten this is because you're not sending requests to the pact mock server
Thanks Matt for the response