Repository navigation
v0.10.0
[0.10.0] - 2024-12-25
Added
-
nextcov initcommand - Interactive scaffolding for nextcov setup- Creates
global-setup.ts,global-teardown.ts, andtest-fixtures.ts - Modifies
playwright.config.tswith nextcov configuration - Adds npm scripts (
dev:e2e,build:e2e,start:e2e,test:e2e,coverage:merge) topackage.json - Modifies
next.config.tswith E2E mode settings for source maps - Options:
--client-only,--e2e-dir,--js,--force,-y(skip prompts)
- Creates
-
Coverage mode selection in
nextcov init- Choose between Full and Client-only modes- Full mode: Creates
global-setup.tswith server coverage,dev:e2euses--inspect - Client-only mode: Creates
global-setup.tsfor client coverage, simplerdev:e2escript,collectServer: falsein config
- Full mode: Creates
-
initCoverage()function - Unified entry point for globalSetup- Works for both client-only and full (client + server) modes
- Replaces the confusing pattern of calling
startServerCoverage()for client-only mode - Example:
await initCoverage(config)in global-setup.ts
-
Vite support - Client-only coverage for Vite applications
- Detects Vite source URLs (e.g.,
http://localhost:5173/src/App.tsx) - Use
collectServer: falsein nextcov config for Vite apps - Full example in README under "Vite Support" section
- Detects Vite source URLs (e.g.,
-
text-summaryin default reporters - Bothnextcov inittemplates andnextcov mergeCLI now includetext-summaryreporter by default -
Component test coverage in merge script -
coverage:mergescript now includescoverage/componentdirectory- Generated script:
nextcov merge coverage/unit coverage/component coverage/e2e -o coverage/merged
- Generated script:
-
--no-stripoption fornextcov merge- Disable automatic stripping of import statements and directives- By default,
mergestrips import statements and'use client'/'use server'directives for accurate merged coverage - Use
--no-stripto preserve original coverage data
- By default,
Fixed
-
Client-only mode in
nextcov init- Fixed several issues with client-only setupdev:e2escript now correctly usesE2E_MODE=trueinstead of--inspectflag- Global teardown template includes correct comment for client-only mode
- Playwright config correctly sets
collectServer: false
-
Full mode (client + server) in
nextcov init- Fixed server coverage setupstart:localscript includesNODE_V8_COVERAGEfor proper server coverage collection- Webpack config properly handles
isServerparameter for source map paths - Added
devtoolModuleFilenameTemplatefor accurate server-side source mapping
-
Config loading in CJS projects - Fixed
loadNextcovConfig()not loading config fromplaywright.config.tsin projects without"type": "module"in package.json- In CJS projects, named exports like
export const nextcov = {...}appear undermodule.default.nextcovinstead ofmodule.nextcov - Now checks multiple locations:
module.nextcov,module.default?.nextcov, andactualConfig?.nextcov
- In CJS projects, named exports like