-
-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request validation fails after upgrade to v12 #1106
Comments
It looks like the core is expecting two headers, as can be seen by it expecting it at index 1 (not index 0, for 1 value for It received the right request:
But you can see it's expecting two:
It works in |
I've traced it to this commit. I'll raise this issue upstream to track it, thanks for reporting. |
👋 Hi! The 'smartbear-supported' label has just been added to this issue, which will create an internal tracking ticket in PactFlow's Jira (PACT-1219). We will use this to prioritise and assign a team member to this task. All activity will be public on this ticket. For now, sit tight and we'll update this ticket once we have more information on the next steps. |
I should say, in this case, I think because the import { PactV3 } from '@pact-foundation/pact';
import axios from 'axios';
import path from 'path';
const provider = new PactV3({
port: 8082,
dir: path.resolve(process.cwd(), 'pacts'),
cors: true,
consumer: 'application',
provider: 'applicationApi',
logLevel: 'debug',
});
describe('serviceUnderTest', () => {
it('should validate PUT request', async () => {
await provider.addInteraction({
states: [{ description: 'resource exists' }],
uponReceiving: 'update',
withRequest: {
method: 'PUT',
path: '/resource/1',
headers: {
Foo: 'bar',
},
body: {
id: 1,
},
},
willRespondWith: {
status: 200,
headers: {
'Content-Type': 'application/json',
},
body: {
id: 1,
},
},
});
await provider.executeTest(async () => {
await axios.put(
'http://localhost:8082/resource/1',
{
id: 1,
},
{
headers: {
Foo: 'bar',
},
}
);
});
});
}); |
I can confirm that if I omit the |
Thanks for confirming. |
Software versions
Issue Checklist
Please confirm the following:
Expected behaviour
I updated PactJS from 11.0.2 to 12.1.0 and without any other changes the contract test started failing.
Actual behaviour
Steps to reproduce
Relevant log files
pact-debug.log
The text was updated successfully, but these errors were encountered: