Skip to content

[BUG] Compodoc always reports incorrect 0% coverage for some files #1728

Closed

Description

@Tezra
Overview of the issue

Compodoc reports incorrect coverage on some files that contain headers

Operating System, Node.js, npm, compodoc version(s)

OS: linux
Node: v24.15.0
npm: 11.12.1
Compodoc: v1.2.1

Compodoc installed globally or locally ?

Ran globally via npx @compodoc/compodoc -p tsconfig.json --coverageTest 80 --coverageMinimumPerFile 80 --coverageTestShowOnlyFailed -t

If possible sourcecode of the file where it breaks
/**
 * @license
 * @copyright
 */

/**
 * Does the thing.
 * @param a thing.
 * @param b thing.
 * @returns A thing.
 */
export function exampleFn(
  a: string,
  b: string,
): unknown {
  return null;
}

If possible your terminal logs before the error

npx @compodoc/compodoc -p tsconfig.json --coverageTest 100 --coverageMinimumPerFile 100 --coverageTestShowOnlyFailed -t
npm warn Unknown env config "unsafe-perm". This will stop working in the next major version of npm. See npm help npmrc for supported config options.
Compodoc v1.2.1
[14:35:32] 0 % for file src/lib/utils/example.ts - exampleFn - under minimum per file

Motivation for or Use Case

Using Compodoc to ensure all functions/types have been documented.

Reproduce the error

run npx @compodoc/compodoc -p tsconfig.json --coverageTest 80 --coverageMinimumPerFile 80 --coverageTestShowOnlyFailed -t against the provided example file.

It seems Compodoc does not like the @license / @copyright header tags. Issue does not occur when header does not contain those tags, or if anything is imported after the header. Otherwise Compodoc always reports 0% coverage for that file.

Workarounds

A) Import anything after the header (can be a type import).
B) Don't include the license/copyright headers (probably not an option if you are using them)

Activity

  1. added a commit that references this issue on May 22, 2026
    c0a53ba
  2. Tezra commented on May 22, 2026

    @Tezra
    Author

    @vogloblinsky Thanks for fixing this so fast! Do you have any estimate of when the next release will go out?

  3. vogloblinsky commented on May 23, 2026

    @vogloblinsky
    Contributor

    This weekend ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions