While using `PactV3` I am seeing this warning: ```...
# pact-js
j
While using
PactV3
I am seeing this warning:
Copy code
WARN ThreadId(01) pact_models::pact: Note: Existing pact is an older specification version (V3), and will be upgraded
Followed by these trace logs:
Copy code
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
?
m
Mind sharing your setup code?
j
Apologies but I do not have a repo that I can share, so here is some sanitized code:
Copy code
import { PactV3 } from '@pact-foundation/pact';

const provider = new PactV3({
    consumer: 'some-client',
    provider: 'some-provider',
    logLevel: 'trace',
});

describe('pact test', () => {
    const provider = getProvider();

    beforeEach(() => {
        const interaction = {
            state: 'I have stuff',
            uponReceiving: 'a request for stuff',
            withRequest: {
                ...
            },
            willRespondWith: {
                ...
            },
        };

        provider.addInteraction(interaction);
    });

    test('expected body', async () => {
        return provider.executeTest(async mockserver => {
          ...
        });
    });
});
With these versions:
Copy code
"node_modules/@pact-foundation/pact": {
    "version": "12.3.0",
    "dependencies": {
        "@pact-foundation/pact-core": "^14.3.0",
m
you don’t happen to already have a Pact file there do you? Pact appends to the existing file, so if you previously used the V4 interface or generated a V4 pact it will notice and print that warning
👀 1
j
Same issue when clearing pact files. FWIW here is versioning listed in the resulting pact file:
Copy code
"metadata": {
    "pact-js": {
      "version": "12.3.0"
    },
    "pactRust": {
      "ffi": "0.4.16",
      "models": "1.1.19"
    },
    "pactSpecification": {
      "version": "3.0.0"
    }
  },