woocommerce-paypal-payments/tests/js/__mocks__/@wordpress/i18n.js
2025-09-10 19:09:15 +04:00

12 lines
301 B
JavaScript

// Mock for @wordpress/i18n
const __ = jest.fn( ( text, domain ) => text );
const sprintf = jest.fn( ( format, ...args ) => {
let index = 0;
return format.replace( /%[sd]/g, () => {
const arg = args[ index++ ];
return arg !== undefined ? String( arg ) : '';
} );
} );
export { __, sprintf };