Miguel Heitor
01/23/2024, 10:41 AM{
items: {
123: {
id: 123, -> i want to check this
type: 'type' -> i want to check this
},
456: {
id: 456,
type: 'another_type'
}
}
}
im trying on the consumer side to add a similar response on the willRespondWith
, but im not being able to make the key part as those are being set in the provider state and im not able to add a functionSlackbot
01/23/2024, 2:07 PMboden winkel
01/23/2024, 7:21 PMSpecified pact file '/pacts/somePact.json' does not exist. This sometimes indicates one of the arguments has been specified with the wrong name and has been incorrectly identified as a file path. If you are using Docker, check that you have mounted the pact file or directory into the container correctly using `-v`, and have specified the location of the pact file or directory in the *Docker container*, not the *host*.
chmod 755 $(Build.SourcesDirectory)/someFolder/src/pacts/somePact.json
docker run --rm -v $(Build.SourcesDirectory)/someFolder/src/pacts/somePact.json:/pacts pactfoundation/pact-cli:latest pact-broker publish /pacts/somePact.json --broker-base-url=<https://somecompany.pactflow.io> --broker-token=token--consumer-app-version=$(version.packageSemVer)
Gawaine O'Gilvie
01/26/2024, 5:00 PMMark Kellett
01/29/2024, 4:26 PMkyle potter
01/30/2024, 12:37 PMArina Razmyslovich
01/30/2024, 5:04 PMPrasad
02/01/2024, 12:35 PMPrasad
02/01/2024, 12:36 PMkyle potter
02/01/2024, 3:11 PMChandan Verma
02/02/2024, 10:31 AMChandan Verma
02/02/2024, 10:32 AMMiguel Heitor
02/08/2024, 9:46 AMMateus Barbosa
02/20/2024, 3:31 PMNiels S
02/22/2024, 3:38 PMQuinn
02/22/2024, 11:41 PMeachLike
function I’m using. It seems to me like eachLike
doesn’t like to match on interpolated strings…. I could use some help tracking this down!Joel Whalen
02/23/2024, 12:15 AMMockedProvider
apollo client component for writing consumer tests? I see in the example that there is an ApolloClient
defined, but for my use case, I'm writing these tests in a separate package that doesn't instantiate an ApolloClient
anywhere; all the unit tests for this interface look kinda like this (using react testing library):
render(
<MockedProvider mocks={mocks} addTypename={false}>
<TestComponent />
</MockedProvider>
);
const results = screen.getByText(/queryResults/i);
expect(results).toHaveTextContent('true');
where the actual request I want to write a contract for is being done inside of TestComponent
when it's rendered in the context of MockedProvider
. It would be nice if the MockedProvider
api had a url prop, but it doesn't. Is there a clean way to render this test component in the context of the pact mock server? Or do I need to instantiate my own custom ApolloClient
and pass it the mock server url, even though this isn't exactly how the underlying app code works?Nicolas Alejandro Vaquero
02/26/2024, 2:46 PMrecord-release
• pactfoundation/pact-cli:latest pact-broker record-deployment
based on https://docs.pact.io/pact_broker/recording_deployments_and_releases
At the moment I have seen that we can only use can-i-deploy
(file)
Is it in the roadmap? Should I create an issue requesting for this feature?Efe Ofluoglu
02/28/2024, 11:57 AMpact-msw-adapter
to generate pact files for me. However, the generated pact file does not have matchingRules
. I've also looked at the example here which also generates a pactfile without matchers. https://docs.pactflow.io/docs/examples/bi-directional/consumer/msw/#source-code
How can I generate pacts with type matchers using the adapter, (like, eachLike etc..
) as it does when you manually write the pacts without the adapter?Dany Marques
03/01/2024, 7:16 AM~/Documents/mobi_projects/defant-taskclient-rwc git:[feature/WV-2439-angular-17-migration]
npm i -D @pact-foundation/pact
npm ERR! code 1
npm ERR! path /Users/danymarques/Documents/mobi_projects/defant-taskclient-rwc/node_modules/@pact-foundation/pact-core
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@18.18.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.9.6 found at "/Library/Developer/CommandLineTools/usr/bin/python3"
npm ERR! gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/Users/danymarques/Documents/mobi_projects/defant-taskclient-rwc/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/danymarques/Documents/mobi_projects/defant-taskclient-rwc/node_modules/@pact-foundation/pact-core/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/danymarques/Documents/mobi_projects/defant-taskclient-rwc/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/danymarques/Library/Caches/node-gyp/18.18.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/danymarques/Library/Caches/node-gyp/18.18.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/danymarques/Documents/mobi_projects/defant-taskclient-rwc/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/danymarques/Library/Caches/node-gyp/18.18.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/danymarques/Documents/mobi_projects/defant-taskclient-rwc/node_modules/@pact-foundation/pact-core',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: binding.gyp not found (cwd: /Users/danymarques/Documents/mobi_projects/defant-taskclient-rwc/node_modules/@pact-foundation/pact-core) while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/Users/danymarques/Documents/mobi_projects/defant-taskclient-rwc/node_modules/node-gyp/lib/configure.js:271:18)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm ERR! gyp ERR! System Darwin 23.2.0
npm ERR! gyp ERR! command "/Users/danymarques/.nvm/versions/node/v18.18.0/bin/node" "/Users/danymarques/Documents/mobi_projects/defant-taskclient-rwc/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/danymarques/Documents/mobi_projects/defant-taskclient-rwc/node_modules/@pact-foundation/pact-core
npm ERR! gyp ERR! node -v v18.18.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in: /Users/danymarques/.npm/_logs/2024-02-29T17_44_16_466Z-debug-0.log
SSh
03/01/2024, 2:29 PMeachKeyMatches
and eachValueMatches
simultaneously)
I need something like eachKeyValueMatches
but it doesn't exist
Example
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 ?
})
})
Slackbot
03/01/2024, 2:29 PMSSh
03/05/2024, 2:13 PMMiguel Heitor
03/15/2024, 2:58 PMsocket hang up
partJoe
03/15/2024, 5:15 PMPact
and the versioned exports in this case? How do I determine which one to use?
import { Pact, PactV3, PactV4 } from '@pact-foundation/pact';
Joe
03/15/2024, 10:12 PMPactV3
I am seeing this warning:
WARN ThreadId(01) pact_models::pact: Note: Existing pact is an older specification version (V3), and will be upgraded
Followed by these trace logs:
TRACE ThreadId(01) pact_ffi::mock_server::handles: with_pact before - ref = 2, inner = RefCell { value: PactHandleInner { pact: V4Pact
Notice the V4Pact
👆
Why is that V4
seems to be involved when I specifically setup with V3
?thibault alix
03/19/2024, 1:21 AMwillRespondWith: {
status: 200,
headers: { 'Content-Type': 'text/html; charset=utf-8' },
body: somethingLike('<html>some content</html>')
}
actual response from the provider is:
<html>
<head>
lots of stuff
</body>
</html>
current error:
Expected body '{"value":"<html></html>","pact:matcher:type":"type"}' to match '
<html>
<head>
lots of stuff
</body>
</html>'
thank you!Pere Villega
03/26/2024, 12:15 PMJonathan Chapman
03/28/2024, 4:02 PMpact
with nestjs
, but it looks like the nestjs-pact
is pretty outdated. Are there any plans to get it updated?Alex Kaufman
03/28/2024, 5:06 PM2024-03-26T215454.878503Z ERROR ThreadId(01) pact_ffi:mock serverhandles Failed to parse the value: expected value at line 1 column 1
2024-03-26T215454.878633Z ERROR ThreadId(01) pact_ffi:mock serverhandles Failed to parse the value: expected value at line 1 column 1
2024-03-26T215454.878643Z DEBUG ThreadId(01) pact_ffi:mock serverhandles parsed header value: Left("application/json")
Received message: "invalid json response body at reason: Unexpected end of JSON input"This looks similar to the error reported here: https://github.com/pact-foundation/pact-js/issues/1141 • Curious if there are plans to make sure this package works with fetch?