nestjs / schematics

Nest architecture element generation based on Angular schematics 🎬
https://nestjs.com
MIT License
381 stars 205 forks source link

Error when using 'application' generator in a directory that doesn't has the 'test' folder #1492

Closed micalevisk closed 1 year ago

micalevisk commented 1 year ago

Is there an existing issue for this?

Current behavior

you'll se following error when running nest g app foo in a dir that does not has the 'test' folder:

Error: Path "/test" does not exist.

Failed to execute command: node @nestjs/schematics:sub-app --name=foo --no-dry-run --no-skip-import --language="ts" --source-root="src" --spec --no-flat --spec-file-suffix="spec"

Minimum reproduction code

see below

Steps to reproduce

git clone git@github.com:nestjs/typescript-starter.git
cd typescript-starter
npm install @nestjs/cli@10.1.10
rm -rf test
npx nest g app foo

Expected behavior

I think that the CLI shouldn't assume that every project will have a 'test' folder in their nestjs projects, so that command should went fine as when we have such folder

Package version

10.0.1

NestJS version

No response

Node.js version

No response

In which operating systems have you tested?

Other

No response

kamilmysliwiec commented 1 year ago

Let's track this here https://github.com/nestjs/schematics/pull/1493