Skip to content

Commit

Permalink
Fix failing filter test (woocommerce#7253)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexflorisca authored and senadir committed Nov 12, 2022
1 parent 357df87 commit 70839c3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/checkout/filter-registry/test/index.js
Expand Up @@ -66,15 +66,17 @@ describe( 'Checkout registry', () => {
.mockImplementation( () => {} );

const error = new Error( 'test error' );
// We use this new filter name here to avoid return the cached value for the filter
const filterNameThatThrows = 'throw';
const value = 'Hello World';
__experimentalRegisterCheckoutFilters( filterName, {
[ filterName ]: () => {
__experimentalRegisterCheckoutFilters( filterNameThatThrows, {
[ filterNameThatThrows ]: () => {
throw error;
},
} );
const { result: newValue } = renderHook( () =>
__experimentalApplyCheckoutFilter( {
filterName,
filterName: filterNameThatThrows,
defaultValue: value,
} )
);
Expand Down

0 comments on commit 70839c3

Please sign in to comment.