Generates jest.config.cjs for unit testing configuration. Configures Jest with Vue, TypeScript support, coverage thresholds, and test environment settings.
Generate the jest.config.cjs file for unit testing configuration with Jest.
This skill should ONLY be used if the project uses Jest instead of Vitest.
package.json for test framework dependency:"vitest" found → SKIP THIS SKILL (use vitest-config skill instead)"jest" found → EXECUTE THIS SKILLNote: Vitest is the officially recommended test framework for Vue 3 projects as of 2024+. Jest is considered legacy but still widely used.
This skill MUST create exactly 1 file:
jest.config.cjs (preferred format - CommonJS)⚠️ HIGH PRIORITY: Verify current Jest ecosystem to prevent outdated configuration
jest.config.cjs format is still recommended@vue/vue3-jest is still maintainednpm view @vue/vue3-jest timev8 vs babel coverage providerv8 is still recommended over babelts-jest transformerts-jest is still maintainedpackage.json for ESM-only packages (axios, date-fns, etc.)transformIgnorePatternsjsdom is still recommendedjsdom or node environment is appropriatejsdom version compatibility.cjs format is still preferred.js, .mjs, .json, package.json field alternativesCreate the file: jest.config.cjs
Supported Format:
jest.config.cjs (strict preferred format - CommonJS, most compatible)Alternative Formats (only if .cjs deprecated):
jest.config.js (JavaScript, follows package.json type)jest.config.mjs (ES Module format)jest.config.json (JSON format, limited functionality)See: examples.md in this directory for complete examples and detailed explanations.
⚠️ IMPORTANT: The examples.md file contains December 2025 configurations. Always verify current Jest ecosystem before using.
@vue/vue3-jest maintenance status@vue/vue3-jest unmaintained, prompt user for decisionts-jest transformer compatibilityv8 vs babel)jsdom test environment compatibilityjest.config.cjs with current standardsSTOP! Before proceeding to the next skill, verify:
Run this command to verify the file exists:
if [ -f "jest.config.cjs" ] || [ -f "jest.config.js" ] || [ -f "jest.config.mjs" ] || grep -q "\"jest\":" package.json 2>/dev/null; then
echo "✓ Jest configuration found"
if [ -f "jest.config.cjs" ]; then
echo "✓ Using jest.config.cjs (preferred format)"
fi
# Check for Vitest conflict
if grep -q "\"vitest\"" package.json 2>/dev/null; then
echo "⚠ WARNING: Both Jest and Vitest detected in package.json"
echo " Consider using only one test framework"
fi
else
echo "✗ Jest configuration missing"
exit 1
fi
jest.config.cjs exists at project rootmodule.exports)preset: 'ts-jest' for TypeScript supporttestEnvironment: 'jsdom' for DOM testing@vue/vue3-jest - if maintained)transformIgnorePatterns includes detected ESM packagesv8 or babel)@/ → src/)DO NOT PROCEED to the next skill. Create or fix the missing/incorrect file immediately.
v8 is faster and more accurate than babel (verify current recommendation)@vue/vue3-jest transforms Vue SFC files (check maintenance status)ts-jest transforms TypeScript filestransformIgnorePatterns allows testing ESM packages@/ path aliases and asset importsjsdom provides DOM APIs for component testing.cjs ensures compatibility with all module systems