<#1090 Error in native callback> Issue created by ...
# pact-js-development
g
#1090 Error in native callback Issue created by druoid Software versions • OS: _e.g. Mac OS 13.3.1 • Pact library: _e.g. @pact-foundation/pact@10.1.2 • Node Version: v18.7.0 Issue Checklist Please confirm the following: ☑︎ I have upgraded to the latest ☑︎ I have the read the FAQs in the Readme ☑︎ I have triple checked, that there are no unhandled promises in my code and have read the section on intermittent test failures ☑︎ I have set my log level to debug and attached a log file showing the complete request/response cycle ☑︎ For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem Expected behaviour Test should pass when publishing pacts to broker (which it does do but test fails) Actual behaviour Test fails even though pacts are published to broker Steps to reproduce Clone repo https://github.com/druoid/pact-js-poc Navigate to examples > v3 > typescript folder npm run test Relevant log files `andrewchambers@Andrews-MacBook-Pro typescript % npm run test
typescript-pact-v3@1.0.0 test
nyc --check-coverage --reporter=html --reporter=text-summary mocha test/*.spec.ts
The Users API (consumer) get /users/:id 2023-05-10T002032.811713Z DEBUG ThreadId(01) pact_plugin_driver:catalogue manager Updated catalogue entries: core/transport/http core/transport/https 2023-05-10T002032.811765Z DEBUG ThreadId(01) pact_plugin_driver:catalogue manager Updated catalogue entries: core/content-generator/binary core/content-generator/json core/content-matcher/json core/content-matcher/multipart-form-data core/content-matcher/text core/content-matcher/xml 2023-05-10T002032.811791Z DEBUG ThreadId(01) pact_plugin_driver:catalogue manager Updated catalogue entries: core/matcher/v1-equality core/matcher/v2-max-type core/matcher/v2-min-type core/matcher/v2-minmax-type core/matcher/v2-regex core/matcher/v2-type core/matcher/v3-content-type core/matcher/v3-date core/matcher/v3-datetime core/matcher/v3-decimal-type core/matcher/v3-includes core/matcher/v3-integer-type core/matcher/v3-null core/matcher/v3-number-type core/matcher/v3-time core/matcher/v4-array-contains core/matcher/v4-equals-ignore-order core/matcher/v4-max-equals-ignore-order core/matcher/v4-min-equals-ignore-order core/matcher/v4-minmax-equals-ignore-order core/matcher/v4-not-empty core/matcher/v4-semver 2023-05-10T002032.812059Z DEBUG ThreadId(01) pact_mock_server:mock server Started mock server on 127.0.0.1:56365 2023-05-10T002032.816098Z DEBUG tokio-runtime-worker hyper:protoh1io parsed 4 headers 2023-05-10T002032.816114Z DEBUG tokio-runtime-worker hyper:protoh1conn incoming body is empty 2023-05-10T002032.816121Z DEBUG tokio-runtime-worker pact_mock_server:hyper server Creating pact request from hyper request 2023-05-10T002032.816124Z DEBUG tokio-runtime-worker pact_mock_server:hyper server Extracting query from uri /users/1 2023-05-10T002032.816146Z INFO tokio-runtime-worker pact_mock_server:hyper server Received request HTTP Request ( method: GET, path: /users/1, query: None, headers: Some({"accept": ["application/json"], "connection": ["close"], "host": ["127.0.0.1:56365"], "user-agent": ["axios/0.27.2"]}), body: Empty ) 2023-05-10T002032.816183Z INFO tokio-runtime-worker pact_matching: comparing to expected HTTP Request ( method: GET, path: /users/1, query: None, headers: None, body: Missing ) 2023-05-10T002032.816187Z DEBUG tokio-runtime-worker pact_matching: body: '' 2023-05-10T002032.816189Z DEBUG tokio-runtime-worker pact_matching: matching_rules: MatchingRules { rules: {PATH: MatchingRuleCategory { name: PATH, rules: {} }} } 2023-05-10T002032.816192Z DEBUG tokio-runtime-worker pact_matching: generators: Generators { categories: {} } 2023-05-10T002032.816205Z DEBUG tokio-runtime-worker pact_matching:matchers String -> String: comparing '/users/1' to '/users/1' ==> true cascaded=false matcher=Equality 2023-05-10T002032.816275Z DEBUG tokio-runtime-worker pact_matching: expected content type = '_/_', actual content type = '_/_' 2023-05-10T002032.816296Z DEBUG tokio-runtime-worker pact_matching: content type header matcher = 'RuleList { rules: [], rule_logic: And, cascaded: false }' 2023-05-10T002032.816305Z DEBUG tokio-runtime-worker pact_matching: --> Mismatches: [] 2023-05-10T002032.816332Z DEBUG tokio-runtime-worker pact_mock_server:hyper server Test context = {"mockServer": Object {"href": String("http://127.0.0.1:56365"), "port": Number(56365)}} 2023-05-10T002032.816343Z INFO tokio-runtime-worker pact_mock_server:hyper server Request matched, sending response HTTP Response ( status: 200, headers: Some({"Content-Type": ["application/json"]}), body: Present(40 bytes, application/json) ) 2023-05-10T002032.816347Z DEBUG tokio-runtime-worker pact_mock_server:hyper server body: '{"age":39,"id":1,"name":"Homer Simpson"}' 2023-05-10T002032.816374Z DEBUG tokio-runtime-worker hyper:protoh1io flushed 392 bytes ✔️ returns the requested user (consumer) Pact Verification [2023-05-10 002032.820 +0000] INFO (69083 on Andrews-MacBook-Pro.local): pact-node@10.17.7: Verifying Pact Files [122032.749] DEBUG (69083): pact-core@13.13.5: Initalising native core at log level 'debug' [122032.809] DEBUG (69083): pact@10.1.2: free port discovered: 56365 [122032.811] DEBUG (69083): pact@10.1.2: Setting up Pact mock server with Consumer "User Web" and Provider "User API" using mock service on Port: "56365" [122032.812] DEBUG (69083): pact@10.1.2: mock service started on port: 56365 2023-05-10T002033.909547Z DEBUG tokio-runtime-worker hyper:protoh1io parsed 4 headers 2023-05-10T002033.909564Z DEBUG tokio-runtime-worker hyper:protoh1conn incoming body is empty 2023-05-10T002033.909570Z DEBUG tokio-runtime-worker pact_mock_server:hyper server Creating pact request from hyper request 2023-05-10T002033.909573Z DEBUG tokio-runtime-worker pact_mock_server:hyper server Extracting query from uri /users/1 2023-05-10T002033.909590Z INFO tokio-runtime-worker pact_mock_server:hyper server Received request HTTP Request ( method: GET, path: /users/1, query: None, headers: Some({"host": ["127.0.0.1:56365"], "cookie": [""], "x-forwarded-for": ["127.0.0.1"], "content-length": ["0"]}), body: Empty ) 2023-05-10T002033.909617Z INFO tokio-runtime-worker pact_matching: comparing to expected HTTP Request ( method: GET, path: /users/1, query: None, headers: None, body: Missing ) 2023-05-10T002033.909619Z DEBUG tokio-runtime-worker pact_matching: body: '' 2023-05-10T002033.909621Z DEBUG tokio-runtime-worker pact_matching: matching_rules: MatchingRules { rules: {PATH: MatchingRuleCategory { name: PATH, rules: {} }} } 2023-05-10T002033.909624Z DEBUG tokio-runtime-worker pact_matching: generators: Generators { categories: {} } 2023-05-10T002033.909632Z DEBUG tokio-runtime-worker pact_matching:matchers String -> String: comparing '/users/1' to '/users/1' ==> true cascaded=false matcher=Equality 2023-05-10T002033.909708Z DEBUG tokio-runtime-worker pact_matching: expected content type = '_/_', actual content type = '_/_' 2023-05-10T002033.909723Z DEBUG tokio-runtime-worker pact_matching: content type header matcher = 'RuleList { rules: [], rule_logic: And, cascaded: false }' 2023-05-10T002033.909729Z DEBUG tokio-runtime-worker pact_matching: --> Mismatches: [] 2023-05-10T002033.909752Z DEBUG tokio-runtime-worker pact_mock_server:hyper server Test context = {"mockServer": Object {"href": String("http://127.0.0.1:56365"), "port": Number(56365)}} 2023-05-10T002033.909760Z INFO … pact-foundation/pact-js