diff --git a/packages/sui-test-contract/package.json b/packages/sui-test-contract/package.json index 6d8993431..7e9069923 100644 --- a/packages/sui-test-contract/package.json +++ b/packages/sui-test-contract/package.json @@ -17,8 +17,8 @@ }, "dependencies": { "@pact-foundation/pact": "9.18.1", - "@pactflow/pact-msw-adapter": "1.2.1", - "@s-ui/mock": "1", + "@pactflow/pact-msw-adapter": "2.0.0", + "@s-ui/mock": "typescript", "commander": "8.3.0", "headers-polyfill": "3.1.2" }, 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..de31a0e3c 100644 --- a/packages/sui-test-contract/test/server/setupSpec.js +++ b/packages/sui-test-contract/test/server/setupSpec.js @@ -1,11 +1,12 @@ 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'}