403Webshell
Server IP : 172.67.214.6  /  Your IP : 216.73.216.244
Web Server : LiteSpeed
System : Linux premium900.web-hosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : redwjova ( 1790)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : OFF |  Pkexec : OFF
Directory :  /home/redwjova/near.llc/wp-content/plugins/extendify/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/redwjova/near.llc/wp-content/plugins/extendify/jest.config.js
const defaultConfig = require('@wordpress/scripts/config/jest-unit.config.js');
const webpackConfig = require('./webpack.config.js');

// Extract aliases from webpack config
const webpackAliases = webpackConfig.resolve.alias || {};

// Convert webpack aliases to Jest moduleNameMapper format
// Webpack uses @ prefix with paths, Jest needs regex patterns
const convertAliasesToModuleNameMapper = (aliases) => {
	return Object.entries(aliases).reduce((moduleNameMapper, [alias, path]) => {
		// Convert webpack alias to Jest moduleNameMapper format
		// e.g., @library -> ^@library/(.*)$
		const aliasKey = `^${alias}/(.*)$`;

		// Convert absolute path to relative path that Jest expects
		// Remove any __dirname references and ensure path ends with /$1
		const aliasPath = path.replace(/.*?(?=src)/, '<rootDir>/') + '/$1';

		moduleNameMapper[aliasKey] = aliasPath;
		return moduleNameMapper;
	}, {});
};

// Create Jest moduleNameMapper from webpack aliases
const aliasesModuleNameMapper =
	convertAliasesToModuleNameMapper(webpackAliases);

// Special case for @constants which doesn't have a trailing slash in imports
if (webpackAliases['@constants']) {
	const constantsPath = webpackAliases['@constants'].replace(
		/.*?(?=src)/,
		'<rootDir>/',
	);
	aliasesModuleNameMapper['^@constants$'] = constantsPath;
}

module.exports = {
	...defaultConfig,
	moduleNameMapper: {
		...defaultConfig.moduleNameMapper,
		...aliasesModuleNameMapper,
	},
	setupFiles: ['<rootDir>/jest.setup.js'],
};

Youez - 2016 - github.com/yon3zu
LinuXploit