Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Mock getSetting so it returns the default value
Browse files Browse the repository at this point in the history
  • Loading branch information
opr committed Oct 23, 2023
1 parent 0637ed3 commit 9b8848a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/js/blocks/reviews/test/frontend-block.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ jest.mock( '../utils', () => ( {

jest.mock( '@woocommerce/settings', () => ( {
...jest.requireActual( '@woocommerce/settings' ),
getSetting: jest.fn().mockReturnValue( true ),
getSetting: jest
.fn()
.mockImplementation( ( setting, defaultValue ) => defaultValue ),
} ) );

/**
Expand Down

0 comments on commit 9b8848a

Please sign in to comment.