How to use the @wordpress/scripts/config/jest-unit.config.js.setupFilesAfterEnv function in @wordpress/scripts

To help you get started, we’ve selected a few @wordpress/scripts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Automattic / wp-calypso / apps / full-site-editing / jest.config.js View on Github external
// @wordpress/scripts manually adds additional Jest config ontop of
// @wordpress/jest-preset-default so we pull in this file to extend it
const defaults = require( '@wordpress/scripts/config/jest-unit.config.js' );

module.exports = {
	...defaults,
	setupFilesAfterEnv: [
		...( defaults.setupFilesAfterEnv || [] ), // extend if present
		'/test/client/test-setup',
	],
};