Skip to content

Diagnostics ​

Diagnostics describe the scanned code and do not by themselves change a completed scan's exit code from 0. Invalid arguments, output failures and unexpected crashes can still exit with 2; see exit codes. A diagnostic's level is error when tests may be missing, and warning when a value is missing or approximate. Start with troubleshooting for steps to resolve common problems.

Files and imports ​

CodeLevelWhen
read-errorerrorA test file or a folder could not be read, or a test file is a link to a file that does not exist.
parse-errorerrorThe file has a syntax error, or brackets nested more than 500 deep, which would crash the parser, or expressions nested more than 1,000 deep, which the scan can't walk, or code the parser can't hand over, such as a JSX name written as a Unicode escape; such a file is not parsed at all. When the parser recovers from a syntax error, the tests it read are kept.
internal-errorerrorReading the file or a config failed unexpectedly. Please report it with the file if you can. The scan goes on with the next file, and reads none of the config's settings.
framework-mismatcherrorThe file imports another framework, such as Vitest in a Playwright scan, @jest/globals in a Vitest scan or bun:test in a node:test scan, or imports a test object that local files build from or re-export from one. A module the config's alias maps to a local file, as a shim of bun:test for Vitest, is followed instead. A helper the file calls from a module that imports another framework counts only when the helper uses what that module imports.
unresolved-test-importerrorA call shaped like a test, outside any test or hook body, uses a name imported from a module that could not be followed. Files are followed through re-exports and extend chains; the message says where the chain ends: a missing or broken file, an installed package, or a file that doesn't export a test object. A chain that ends at another runner's module is a framework-mismatch instead. The name reads like a test function, as test or checkoutTest do, or is followed by a member such as .describe.
invalid-importerrorVitest imported in a way it does not support: a default import, or require('vitest').
no-files-matchedwarningNo test file matches the patterns, or without patterns, no config finds one. When a pattern names a folder, the message suggests a pattern for the test files in it; when Cypress, WebdriverIO or Jasmine has its config in a folder below the root, which the scan doesn't read, it names that folder. The command line also says so on standard error.
unsupported-filewarningA file that matches the patterns is not JavaScript or TypeScript, so it is not read.
symlink-ignoredwarningA test file reached through a symbolic link is left out: Playwright and Jest don't follow such links, and for Cypress and WebdriverIO the scan doesn't. Vitest, Mocha, Jasmine and Bun follow them and run the file once, so for them it is read, and Bun names it by its own path. node:test follows a linked file, and runs it twice when its own path matches too, but a wildcard in its pattern doesn't enter a linked folder: such a file gets this warning unless the pattern names the folder.
local-test-objectwarningA variable or function named like a test object makes one in a way the scan cannot follow, as in const it = await createTester() or liveBrokerTest(options)('title', fn). Calls on it shaped like tests are read as tests.
globals-not-enabledwarningA Vitest file uses describe, it or test without importing them, the config it uses doesn't set test.globals to true, and no tsconfig has vitest/globals in its types. A Jest file uses them while the config that runs it sets injectGlobals to false.
file-not-runwarningA file the patterns match has tests, but no config in its folder or above runs it, nor a config a package.json script there starts the runner with, so the runner doesn't collect them. A file a collected test file imports isn't reported, as its tests run in that file. The message names the nearest config; see configs.
forbidden-onlyerror, warning under a conditionA .only the config makes fail. Playwright's forbidOnly and Mocha's forbid-only make the run fail before any test runs. Vitest's allowOnly off makes Vitest fail the .only test instead of running it; it is off by default when process.env.CI is set, which is a warning. When either depends on a condition, as in !!process.env.CI, it is a warning that quotes it.
dependency-not-followedwarningSomething a test runs can't be followed: a local file that is missing or doesn't parse, import() or require() with a path worked out at run time from anything but string literals and the module's own folder, an unsupported module glob, a value imported from a module that only a declaration file describes, a setup file the config names in a way the scan can't work out or that doesn't exist, a config that puts snapshots elsewhere than the runner's default, a toMatchFileSnapshot() path worked out at run time or absolute, or an import that a config alias maps to a file that could not be read. Tests that reach it have hasUnfollowedDependencies, and a change there doesn't change their dependencyHash. Reported once per place, where it is written.
unknown-framework-versionwarningThe framework version could not be read from the project; the newest rules apply.
approximate-framework-versionwarningOnly a version range was found, such as ^4.0.0 in package.json; the rules of the newest release in that major apply.
unsupported-framework-versionwarningThe project uses a version older than Playwright 1.31, Vitest 1.0, Jest 27.0, Mocha 10.0, Jasmine 3.0, Cypress 10.0, WebdriverIO 7.0, Node.js 22.0 or Bun 1.2.23.

Declarations ​

CodeLevelWhen
invalid-chainerrorA chain the framework does not have, such as test.only.skip in Playwright or test.only.concurrent in Jest, or one that needs a newer version, such as a Playwright describe with details before 1.42, which throws. Before Playwright 1.42, a test with details is a warning: Playwright takes the details for the body, so the test fails when it runs. Also a title Jest rejects, or extra arguments to test.todo(). Also .retries() after it() or describe() in Cypress, which throws.
invalid-hookerrorJasmine rejected a hook callback or its timeout while registering the suite.
test-without-bodyerrorPlaywright test('title') without a function, which makes Playwright 1.42 and newer fail to load the file and run no tests at all; before 1.42 it is a warning, as the test loads and fails when it runs. Also Jest test('title') or describe('title') without one, which makes Jest fail the file. Also Bun test('title') without a function; Mocha describe('title') without one, or it() or describe() without a title, as in Cypress and WebdriverIO; and Jasmine describe('title') or fit('title') without a function, or it('title', 42).
describe-not-callederrorVitest describe(fn) without a title. Vitest never calls the function.
async-describeerrorA Playwright describe callback that awaits. Playwright does not wait for it: tests declared after the first await end up in the describe around it, or are not collected at all. A Jest describe callback that is async or returns a promise, which makes Jest fail the file. A Jasmine describe callback that is async, which Jasmine refuses.
describe-throwserrorA Jest describe that throws while Jest collects it: its callback returns a value, as () => symbols.map(...) does, or its .each table is empty, isn't a table, or has no function. Jest fails the file. Jasmine: a describe that declares nothing, or whose callback's length is above 0, as (fills) => {}; a TypeScript this, a default value or a rest parameter doesn't count. Cypress: this.retries() in a describe, which fails the spec.
tag-without-aterrorA Playwright tag that does not start with @, which makes Playwright fail to load the file and run no tests at all.
removed-apierrorAn API the framework version removed: Vitest 5 sequential and bench, vi.mock, vi.unmock or vi.hoisted below the top level of the file from Vitest 5, or options as the third argument from Vitest 4. Vitest fails the file. Also env in a Cypress 16 test's or describe's config, which fails each test it applies to when the test runs.
invalid-fixture-argumenterrorA rest property among a Playwright function's fixture arguments, as ({ page, ...fixtures }) in a test, hook, condition or test.extend fixture written in the test file. Playwright fails to load the file.
duplicate-iderrorTwo records in a file have the same id. Ids include a position among equal titles, so only a hash collision causes this.
duplicate-titlewarning, error in PlaywrightPlaywright: two tests in the file have the same title path, without anonymous describes, or a test in a loop with a known count greater than one has the same title path on each pass, so Playwright fails to load the file and runs no tests at all. An unknown loop count alone is not an error, nor is a describe title the scan can't work out, which keeps its source text on every pass. Other runners: two tests in the same describe have the same title.
state-in-helperwarningA test.skip(), test.fixme(), test.fail() or describe.configure() is in a function that the file exports or never calls, so it is not applied to any record. Also given when a call in a test or hook reaches helpers more than 10,000 times, counting the calls inside them; the states set past that are not applied.
skip-without-bodywarningPlaywright test.skip('title') without a function, before Playwright 1.65: Playwright reads the title as a condition and skips every test in the scope. From 1.65 the string is the reason of the skip. Also, before Playwright 1.42, test.fail(title, body), and test.skip(), fixme() or fail() with a title, details and body, which Playwright reads the same way.
nested-testwarningA test or describe declared inside a test body or hook. The runner does not collect it, so it is not listed. A node:test subtest, t.test() or test() in a test's body, is listed with parentTestId instead; a describe() there runs, but is not listed, with this warning.
only-in-skipped-describewarningA test with .only inside a skipped describe. It is still skipped.

Values ​

CodeLevelWhen
dynamic-titlewarningA title could not be worked out, for example a template with a loop variable. The record uses its source text.
dynamic-reasonwarningThe reason of a skip, fixme or fail could not be worked out to a string. The record uses its source text, with hasDynamicReason: true.
unresolved-tagwarningA tag comes from a value that could not be worked out, usually an import. The tag is missing from the record.
unresolved-annotationwarningThe same for an annotation.
unresolved-optionwarningAn options object, a spread in one, a lock, a Vitest flag such as concurrent or only, a meta value, a timeout, retry or repeat count, or the count of expect.assertions() could not be worked out, a timeout is set only under a condition, or a Vitest retry is an object before 4.1, where Vitest never runs the test. What it would set is missing from the record. From Vitest 5, a timeout, retry or repeats that is undefined is left out without a warning, as Vitest leaves it out.
unresolved-caseswarningThe cases of .each or .for could not be counted; caseCount is null.
cases-not-expandedwarningWith --expand-cases, a table is listed as one record: the scan can't work out every value in it or the title, or the title shows a value the scan doesn't format the way the runner does, such as an array or object in Vitest.
test-in-loopwarningThe test is declared in a loop whose values the scan can't work out. It is listed once, while the runner creates one test per iteration, and caseCount is null.
test-in-functionwarningThe test is declared in a function the scan can't place: nothing in the file calls it by name, the file only exports it, or it is called only from tests or hooks. The record stays where the test is written; a test that a helper imported from another file registers from such a function stays at the helper's call. Functions called from the file or a describe have their tests recorded at each call, up to 10,000 calls in a file, where this warning marks the call the scan stopped at; see limits.
empty-titlewarningA test or describe is titled with an empty string. The runners allow it, but reports and filters can't tell it apart.
bench-outside-benchmark-filewarningA test uses Vitest 5's bench fixture outside a benchmark file such as *.bench.ts, where Vitest fails the test. It still has isBenchmark.
config-may-change-statewarningA Vitest file uses tags, and the scan can't work out the tags the Vitest config defines, which can skip tests or change how they run.
undefined-tagerror, warning in a function or conditionA Vitest file uses a tag the config doesn't define, and strictTags is on, as it is unless the config turns it off. Vitest fails the file while it loads, at the first such tag it meets: the file's @module-tag comments first, then the describes' tags, then the tests'. Reported at the first use of each such tag. A use in a function or under a condition fails the file only if that code runs, so it is a warning, and the file's tests keep their state.
config-value-unknownwarning, error in Playwright and Vitest discoveryThe scan reads a setting of the config that it can't work out without running the config, such as globals: process.env.CI === 'true', or it can't read the config at all. Also a Jest preset the scan doesn't read that may choose the test files, and a Jest config Jest refuses: testMatch with testRegex, a testRegex or ignore pattern that isn't a regular expression, or two configs in one folder. Also a Vitest config retry object before 4.1, where Vitest runs no test, Mocha's QUnit and exports interfaces or a ui that names a package, which are read as BDD, and a WebdriverIO config whose framework the scan doesn't read, such as Cucumber, whose specs are read as Mocha's. Also a package.json script that starts the runner with a config or root the scan can't read, such as vitest run -c $CONFIG: the files the configs it reads leave out aren't reported as not run. In Playwright and Vitest discovery, unknown file selection is an error because tests may be missing; readable top-level settings can still select candidates with unknown project membership. The message names the setting and what the scan does instead; see configs.

A Jasmine spec timeout above 2,147,483,647 produces unresolved-option at error level from Jasmine 3.10. A known invalid node:test concurrency value produces unresolved-option at error level when the declaration loads. A concurrency value the scan cannot work out remains a warning, with its mode left unset.

Files the runner refuses to load ​

Some problems make the runner fail while it loads a file:

  • Playwright: test-without-body, tag-without-at, invalid-chain, duplicate-title and invalid-fixture-argument. Playwright then stops before it runs any test, in this file or any other.
  • Vitest: invalid-chain, removed-api and undefined-tag. Vitest reports the file as failed and runs none of its tests; other files still run.
  • Jest: invalid-chain, test-without-body, async-describe and describe-throws. Jest reports the file as failed and runs none of its tests; other files still run.
  • Mocha: invalid-chain and test-without-body. Mocha then stops before it runs any test, in this file or any other.
  • Jasmine: invalid-chain, invalid-hook, test-without-body, async-describe and describe-throws, at the top level of a file. Jasmine then stops before it runs any spec, in this file or any other. Inside a describe, Jasmine catches them: it reports the describe as failed and registers none of the specs written after the call in it, and the file's other tests keep their states.
  • Cypress: invalid-chain, test-without-body and describe-throws. Cypress then fails the spec and runs none of its tests; other specs still run.
  • WebdriverIO: invalid-chain and test-without-body, and with Jasmine invalid-hook, async-describe and describe-throws. With Mocha, the file stops loading at the call: the tests declared above it run, and only those at or below it are notLoaded. With Jasmine, a call at the top level fails the whole worker, and every test in the file is notLoaded; inside a describe, it is caught as in Jasmine itself. Other workers still run.
  • node:test: invalid-chain, and an error-level unresolved-option for a known invalid concurrency value. At file level the file fails; inside a describe only its tests at or after the refused call are notLoaded, with stateSource: "suite". Earlier tests and tests outside that describe still run.
  • Bun: invalid-chain and test-without-body. At file level the file fails; inside a describe every test of that describe is notLoaded, with stateSource: "suite". Tests outside it still run.

The tests affected by the failure scope above get state: "notLoaded", with stateSource: "file" or "suite" and stateLine at the problem that prevents them from loading. These tests are counted in notLoadedCount, not in activeCount. Everything else about them is kept, so the records show what the file declares once the problem is fixed. A refused call written like a declaration, such as test.only.skip('title', fn) or describe.sequential('title', fn) in Vitest 5, is listed too, as a plain test or describe without the part that fails, so its tests are notLoaded rather than missing. Tests in other files keep their states, even though Playwright runs none of them: the records describe the code, and the diagnostic points at the file to fix.

Only code that runs while the file loads counts. An invalid-chain inside a test, hook or helper body, such as test.step.skip() before Playwright 1.50 or test.slow() in Vitest, runs later and fails only the test that reaches it, so the file loads. A refused call reached only under a condition, as in if (process.env.LEGACY) test.only.skip(...), is reported, but its file's tests keep their states, since the file loads unless the condition holds. So is one in a function the scan can't place, such as one nothing in the file calls, also inside a describe there and in a helper called only from it: it runs only if something calls the function. A test or describe inside a test or hook body is a nested-test warning only, even when its arguments are ones the runner refuses, as it('title') without a function in Jest: the runner refuses it when the test runs.

Example ​

json
{
  "code": "dynamic-title",
  "level": "warning",
  "message": "Title `shows a live quote for ${symbol}` could not be worked out; the record uses its source text.",
  "relativeFilePath": "tests/quotes.spec.ts",
  "lineStart": 6,
  "columnStart": 10,
  "testId": "8be9925edcd4647c",
  "source": "`shows a live quote for ${symbol}`"
}

Vitest's allowOnly is read from the projects that run the test. Projects that disagree produce a warning. Vitest checks focus from modifiers, options and configured tags during collection. A surrounding suite marked skip or todo can suppress the error. A skip inside a test body or a hook happens after the focus check.

Documentation for test-inventory 0.12.2. Released under the MIT License.