From 867bc25f7d9b57a195b405e580650c6b62880cf9 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Fri, 25 Oct 2024 17:31:42 +0530 Subject: [PATCH] Update tests --- projects/js-packages/wp-data-sync/package.json | 1 - ...eate-wp-data-sync.test.ts => create-wp-data-sync.test.js} | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename projects/js-packages/wp-data-sync/tests/{create-wp-data-sync.test.ts => create-wp-data-sync.test.js} (96%) diff --git a/projects/js-packages/wp-data-sync/package.json b/projects/js-packages/wp-data-sync/package.json index eef84f01fa5ab..e8c44223fc913 100644 --- a/projects/js-packages/wp-data-sync/package.json +++ b/projects/js-packages/wp-data-sync/package.json @@ -27,7 +27,6 @@ "@babel/core": "^7.0.0", "@babel/preset-env": "7.24.7", "@babel/preset-typescript": "7.24.7", - "@types/jest": "29.5.12", "@wordpress/data": "10.9.0", "jest": "29.7.0", "react": "18.3.1", diff --git a/projects/js-packages/wp-data-sync/tests/create-wp-data-sync.test.ts b/projects/js-packages/wp-data-sync/tests/create-wp-data-sync.test.js similarity index 96% rename from projects/js-packages/wp-data-sync/tests/create-wp-data-sync.test.ts rename to projects/js-packages/wp-data-sync/tests/create-wp-data-sync.test.js index abe3511c75012..a06066ebfca4e 100644 --- a/projects/js-packages/wp-data-sync/tests/create-wp-data-sync.test.ts +++ b/projects/js-packages/wp-data-sync/tests/create-wp-data-sync.test.js @@ -5,8 +5,9 @@ import { createWpDataSync } from '../src/create-wp-data-sync'; jest.mock( '@wordpress/api-fetch' ); const registerStore = () => { - const { reducers, ...config } = createWpDataSync( 'testSettings', { + const { reducer, ...config } = createWpDataSync( 'testSettings', { endpoint: '/test', + getSliceFromState: state => state.testSettings, } ); const store = createReduxStore( 'some-store-id', { @@ -15,7 +16,7 @@ const registerStore = () => { if ( action.type === 'RESET' ) { return {}; } - return reducers.testSettings( state, action ); + return reducer( state, action ); }, } ), ...config,