HEX
Server: nginx/1.16.1
System: Linux VM-0-14-centos 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: www (1000)
PHP: 8.3.31
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.sceybwg.com/wp-content/plugins/templately/jest.config.js
/**
 * Jest Configuration for Templately React Unit Tests
 *
 * Uses @wordpress/jest-preset-default (bundled with @wordpress/scripts)
 * which provides jsdom environment, babel-jest transform, and WordPress mocks.
 */
module.exports = {
	preset: '@wordpress/jest-preset-default',

	roots: [ '<rootDir>/react-src' ],

	testMatch: [
		'<rootDir>/react-src/**/__tests__/**/*.[jt]s?(x)',
		'<rootDir>/react-src/**/*.test.[jt]s?(x)',
	],

	testPathIgnorePatterns: [
		'/node_modules/',
		'<rootDir>/vendor/',
		'<rootDir>/tests/e2e/',
	],

	moduleNameMapper: {
		// Static asset mocks (must come BEFORE aliases that resolve to asset files)
		'\\.(jpg|jpeg|png|gif|svg|webp)$':
			'<rootDir>/tests/js/__mocks__/fileMock.js',

		// Webpack aliases - icons are React components (iconMock), assets are images (fileMock).
		// Note: image file extensions above catch ~templately-icons/*.png before this pattern.
		'^~templately-icons$': '<rootDir>/tests/js/__mocks__/iconMock.js',
		'^~templately-icons/(.*)$': '<rootDir>/tests/js/__mocks__/iconMock.js',
		'^~templately-assets$': '<rootDir>/tests/js/__mocks__/fileMock.js',
		'^~templately-assets/(.*)$': '<rootDir>/tests/js/__mocks__/fileMock.js',
		'^~templately-hooks/(.*)$': '<rootDir>/react-src/app/hooks/$1',
		'^~templately-hooks$': '<rootDir>/react-src/app/hooks/index.js',
		'^~templately-utils/(.*)$': '<rootDir>/react-src/utils/$1',
		'^~templately-utils$': '<rootDir>/react-src/utils/index.js',
		'^~templately-redux/(.*)$': '<rootDir>/react-src/redux/$1',
		'^~templately-redux$': '<rootDir>/react-src/redux/index.js',

		// lodash-es -> lodash (ESM -> CJS for Jest)
		'^lodash-es$': 'lodash',
		'^lodash-es/(.*)$': 'lodash/$1',
	},

	setupFiles: [ '<rootDir>/tests/js/setup-globals.js' ],

	// @wordpress/jest-preset-default only sets up @wordpress/jest-console.
	// Extend with jest-dom matchers (toBeInTheDocument, toHaveClass, etc.).
	setupFilesAfterEnv: [ '@testing-library/jest-dom' ],

	// Transform all node_modules through babel. Slower but avoids ESM whack-a-mole.
	// The deep import chains (redux -> store -> components -> block-editor -> css-tree etc.)
	// pull in many ESM-only packages that Jest cannot handle natively.
	transformIgnorePatterns: [],
};