Skip to content

Commit 1b61633

Browse files
committed
test(pact): set default port
1 parent 19de43d commit 1b61633

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

test/client/autosuggest-session.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ describe('Autosuggest Session Pact', () => {
3838
chance.pickone(['default', 'inherit'])
3939
).getValue() as never;
4040
const apiVersion = ApiVersion.Version3;
41-
const port = 9000;
42-
const host = `http://localhost:${port}`;
4341
const provider = PactUtils.createPact({
4442
consumer: 'w3w-node-wrapper',
4543
provider: 'api-server',
46-
port,
4744
});
45+
4846
let client: AutosuggestClient;
4947

5048
before(() => provider.setup());
5149

5250
beforeEach(() => {
51+
const { port } = provider.opts;
52+
const host = `http://localhost:${port}`;
5353
client = new AutosuggestClient(
5454
apiKey,
5555
{ host, apiVersion },

test/pact-utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ function createPact(opts: PactOptions) {
1111
dir: path.resolve(process.cwd(), 'pacts'),
1212
logLevel: 'info',
1313
pactfileWriteMode: 'overwrite',
14+
port: 9000,
1415
...opts,
1516
});
1617
}

0 commit comments

Comments
 (0)