Skip to content

New cause of "No test suite found in file" error #9412

@NateRobinsonAA

Description

@NateRobinsonAA

Describe the bug

I came across this error and the fix seemed to be to move the export const statement from the spec, then put it in its own file.

I created a new StackBlitz from the Angular template, ensured that it was the latest version of Angular, installed vitest and jsdom, and added the minimum config to get it up and running.

https://stackblitz.com/edit/stackblitz-starters-sj74ev3n?file=src%2Fabc.spec.ts

Reproduction

Run the test from command line, using npm run test. See that the main.spec.ts file reportedly has no tests, which is false. Then, remove the following line from abc.spec.ts:

import { foo as mainFoo } from './main.spec';

Then, of course, remove the usage of that const from the test. Now the tests all pass.

System Info

Stackblitz

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions