2018-11-16 15:43:51 +00:00
|
|
|
// Set up `wp.*` aliases. Doing this because any tests importing wp stuff will likely run into this.
|
|
|
|
global.wp = {};
|
|
|
|
|
2018-11-30 20:39:16 +00:00
|
|
|
// wcSettings is required by @woocommerce/* packages
|
|
|
|
global.wcSettings = {
|
|
|
|
adminUrl: 'https://vagrant.local/wp/wp-admin/',
|
|
|
|
locale: 'en-US',
|
|
|
|
currency: { code: 'USD', precision: 2, symbol: '$' },
|
|
|
|
date: {
|
|
|
|
dow: 0,
|
|
|
|
},
|
|
|
|
orderStatuses: {
|
|
|
|
pending: 'Pending payment',
|
|
|
|
processing: 'Processing',
|
|
|
|
'on-hold': 'On hold',
|
|
|
|
completed: 'Completed',
|
|
|
|
cancelled: 'Cancelled',
|
|
|
|
refunded: 'Refunded',
|
|
|
|
failed: 'Failed',
|
|
|
|
},
|
2018-12-19 15:55:17 +00:00
|
|
|
l10n: {
|
|
|
|
userLocale: 'en_US',
|
|
|
|
weekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],
|
|
|
|
},
|
2018-11-30 20:39:16 +00:00
|
|
|
};
|
|
|
|
|
2018-11-16 15:43:51 +00:00
|
|
|
const wordPressPackages = [
|
|
|
|
'blocks',
|
|
|
|
'components',
|
|
|
|
'date',
|
|
|
|
'editor',
|
|
|
|
'element',
|
|
|
|
'i18n',
|
|
|
|
];
|
|
|
|
|
|
|
|
wordPressPackages.forEach( ( lib ) => {
|
|
|
|
Object.defineProperty( global.wp, lib, {
|
|
|
|
get: () => require( `@wordpress/${ lib }` ),
|
|
|
|
} );
|
|
|
|
} );
|