Skip to content

feat(schematics): support skipping application testing scaffold - #2354

Open
yudin-s wants to merge 1 commit into
nestjs:v12.0.0from
yudin-s:fix/application-skip-testing
Open

feat(schematics): support skipping application testing scaffold#2354
yudin-s wants to merge 1 commit into
nestjs:v12.0.0from
yudin-s:fix/application-skip-testing

Conversation

@yudin-s

@yudin-s yudin-s commented May 21, 2026

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

The application schematic can skip generated spec files with spec: false, but there is no way for callers to request a project without the full testing scaffold. The generated project still includes e2e test files, Jest scripts/configuration, and Jest/Supertest-related dev dependencies.

Issue Number: Refs nestjs/nest-cli#2575

What is the new behavior?

Adds a skipTesting application schematic option. When enabled, TypeScript and JavaScript application projects are generated without unit/e2e test files, testing scripts, Jest configuration, or Jest/Supertest-related dev dependencies.

This keeps the existing spec: false behavior intact for callers that only want to skip spec files.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Validated with:

npm test -- src/lib/application/application.factory.test.ts --runTestsByPath
npm run build
npm exec -- eslint src/lib/application/application.factory.ts src/lib/application/application.schema.d.ts
npm exec -- prettier --check src/lib/application/application.factory.ts src/lib/application/application.factory.test.ts src/lib/application/application.schema.d.ts src/lib/application/schema.json
git diff --check

npm run lint currently reports pre-existing errors in unrelated files, so the validation above scopes linting to the changed TypeScript sources.

@micalevisk

micalevisk commented Jun 11, 2026

Copy link
Copy Markdown
Member

since we will switch to Vitest in Nestjs v12, I think it would be better to move this change for v12 instead of introducing it in v11.

To be really honest, I don't think we should support skipping test generation on scaffolding. The projects should have some sort of automated tests.

If you really want to remove them, you can easily refactor it later with LLMs.

@yudin-s
yudin-s force-pushed the fix/application-skip-testing branch from 1d35597 to adc5a00 Compare June 12, 2026 02:05
@yudin-s
yudin-s changed the base branch from master to v12.0.0 June 12, 2026 02:05
@yudin-s

yudin-s commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Retargeted this PR to v12.0.0 and rebased the branch.

While resolving the v12 rebase, I kept the v12 Vitest/oxlint scaffold and adapted skipTesting to the new ts-esm application template as well as test config files.

Local checks passed:

  • npm test -- src/lib/application/application.factory.test.ts
  • npm run build
  • npm exec -- oxlint src/lib/application/application.factory.ts src/lib/application/application.factory.test.ts src/lib/application/application.schema.d.ts
  • npm exec -- prettier --check src/lib/application/application.factory.ts src/lib/application/application.factory.test.ts src/lib/application/application.schema.d.ts src/lib/application/schema.json
  • git diff --check

CircleCI is running on the updated head now.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants