nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
67.69k stars 7.63k forks source link

Monorepo mode unit testing executes e2e tests as well #5293

Closed Nosfistis closed 4 years ago

Nosfistis commented 4 years ago

Bug Report

Current behavior

Executing test:cov also executes the e2e tests in monorepo mode (apps folder structure project). This is because the .spec.ts$ is not proper regex to capture unit test files (the dots act as any character).

Expected behavior

All the unit tests of applications/libraries should be executed. The e2e tests should be part of the test:e2e command, or their respective jest-e2e.json files.

Possible Solution

Placing .*\.spec\.ts$ works, as the dots now act as literal characters as well.

Environment


Nest version: 7.4.2


For Tooling issues:
- Node version: 14.8  
- Platform: Windows 

Others:

kamilmysliwiec commented 4 years ago

Would you like to create a PR for this issue? https://github.com/nestjs/schematics/blob/master/src/lib/application/files/ts/package.json https://github.com/nestjs/typescript-starter/blob/master/package.json and all examples in this repo:)

Nosfistis commented 4 years ago

Sure!

Nosfistis commented 4 years ago

Please check the related PRs:

5295

https://github.com/nestjs/typescript-starter/pull/177 https://github.com/nestjs/schematics/pull/462