diff --git a/packages/sui-test-contract/package.json b/packages/sui-test-contract/package.json index 0e680988b..a0fc92b52 100644 --- a/packages/sui-test-contract/package.json +++ b/packages/sui-test-contract/package.json @@ -1,6 +1,6 @@ { "name": "@s-ui/test-contract", - "version": "2.12.0", + "version": "2.13.0-beta.1", "description": "Useful tooling for defining contract tests (based on Pact) that will generate contract documents.", "license": "MIT", "main": "src/index.js", diff --git a/packages/sui-test-contract/src/setup/utils.js b/packages/sui-test-contract/src/setup/utils.js index 37b87eb88..b0d009e47 100644 --- a/packages/sui-test-contract/src/setup/utils.js +++ b/packages/sui-test-contract/src/setup/utils.js @@ -1,6 +1,6 @@ import {stringify} from 'qs' -import {writeData2File} from '@pactflow/pact-msw-adapter/dist/utils/utils.js' +import {createWriter} from '@pactflow/pact-msw-adapter/dist/utils/utils.js' const flatEntries = (input, prefix = '') => Object.entries(input).flatMap(([key, value]) => { @@ -61,7 +61,7 @@ export const writerFactory = providers => (path, data) => { }) console.log(`Writing the Pact file "${path}"`) // eslint-disable-line - writeData2File(path, data) + createWriter()(path, data) } export const mapProviders = providers => diff --git a/packages/sui-test-contract/test/server/setupSpec.js b/packages/sui-test-contract/test/server/setupSpec.js index 7dd4de6bc..7e0b4c0a8 100644 --- a/packages/sui-test-contract/test/server/setupSpec.js +++ b/packages/sui-test-contract/test/server/setupSpec.js @@ -1,11 +1,13 @@ import {expect} from 'chai' import {FetcherFactory} from '@s-ui/domain' -import {rest} from '@s-ui/mock' +import mock from '@s-ui/mock' import {setupContractTests} from '../../src/index.js' import {getContractFileData, removeContractFiles} from '../utils.js' +const {rest} = mock + const fetcher = FetcherFactory.httpFetcher({config: {}}) const consumer = 'test-consumer' const fujiAppleResponse = {color: 'red', type: 'Fuji'}