Any suggestions? I’m suddenly getting this perple...
# pact-js
d
Any suggestions? I’m suddenly getting this perplexing message on a test — this is a new project but this test (and the whole repo in fact) are based on our template project, where I don’t get this error. I really can’t find any information about this.
Copy code
FAIL  src/__tests__/pact/consumer.pact.ts
  ● Test suite failed to run

    The v4 package is currently in beta and requires the 'ENABLE_FEATURE_V4' environment variable to be set

    > 1 | import { Pact } from '@pact-foundation/pact';
        | ^
      2 | import path from 'path';
      3 | import { Express } from 'express';
      4 | import request from 'supertest';

      at Object.<anonymous> (node_modules/@pact-foundation/src/v4/index.ts:10:9)
      at Object.<anonymous> (node_modules/@pact-foundation/src/index.ts:87:1)
      at Object.<anonymous> (src/__tests__/pact/consumer.pact.ts:1:1)
version in
package.json
(same as in the other project where it works):
Copy code
"@pact-foundation/pact": "^10.1.4",
a
@Matt (pactflow.io / pact-js / pact-go) seems to know about this. Was it fixed in 10.3.1?
☝️ 1
m
Yes, apologies. The feature toggle was at the top of the module which was being exported to the top level index. It should only have existed in one version.
Copy code
"@pact-foundation/pact": "^10.1.4",
I don’t think the V4 interface was in that package, so my guess is that you actually have a later version installed (
^
allows minor versions to be installed)
in any case, updating to the latest should fix it. Apologies!
🙂 1
a
So just doing an
npm i
should fix it.
m
I think so
d
Aha — thanks all. I will check this in the morning.
Actually, I did just check and yes, looks like 10.3.0 was installed. I’ll fix it up in the morning.
👍 1
m
All sorted?