-
Notifications
You must be signed in to change notification settings - Fork 224
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
When creating a new NestJS project using nest new [project-name]
, the generated e2e test file contains an incorrect import statement that causes test failures.

This appears to be the same issue reported in nestjs/nest#15657
The bug was already fixed in commit fb8c6d9
which was merged on August 19, 2025. However, the fix is not yet available in the published npm package (@nestjs/schematics@11.0.7), so newly created projects still are still affected.
In that commit, only the "src/lib/application/files/ts/test/app.e2e-specFileSuffix.ts" file was updated.
However, the same fix likely needs to be applied to the following files as well:
src/lib/application/files/js/test/app.e2e-specFileSuffix.js
src/lib/sub-app/files/ts/test/app.e2e-specFileSuffix.ts
src/lib/sub-app/files/js/test/app.e2e-specFileSuffix.js
I'd be happy to open a PR to apply the fix to these files as well, if that's helpful. Please let me know!
Minimum reproduction code
https://github.com/dioKR/nest-tmp/blob/main/test/app.e2e-spec.ts
Steps to reproduce
No response
Expected behavior
The generated e2e test files should contain correct import statements so that tests pass without modification in a newly created project.
import reqeust from 'supertest';
Package version
11.0.7
NestJS version
11.0.10
Node.js version
22.20.0
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response