Fix jest config paths

This commit is contained in:
Chi-Hsuan Huang 2022-03-21 18:28:05 +08:00
parent fdf88c0d94
commit 24595bd2cb
3 changed files with 6 additions and 3 deletions

View File

@ -10,7 +10,10 @@ module.exports = {
__dirname, __dirname,
'build/mocks/woocommerce-settings' 'build/mocks/woocommerce-settings'
), ),
'~/(.*)': path.resolve( __dirname, '../../client/$1' ), '~/(.*)': path.resolve(
__dirname,
'../../../plugins/woocommerce-admin/client/$1'
),
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': path.resolve( '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': path.resolve(
__dirname, __dirname,
'build/mocks/static' 'build/mocks/static'

View File

@ -107,7 +107,7 @@ wooCommercePackages.forEach( ( lib ) => {
} ); } );
} ); } );
const config = require( '../../../config/development.json' ); const config = require( '../../../../plugins/woocommerce-admin/config/development.json' );
// Check if test is jsdom or node // Check if test is jsdom or node
if ( global.window ) { if ( global.window ) {

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
rootDir: './', rootDir: './',
preset: '../packages/js-tests/jest.config.js', preset: '../../../packages/js/js-tests/jest.config.js',
globals: { globals: {
'ts-jest': { 'ts-jest': {
diagnostics: { diagnostics: {