Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng test --include is broken #23396

Closed
1 of 15 tasks
politza opened this issue Jun 17, 2022 · 5 comments · Fixed by #23401
Closed
1 of 15 tasks

ng test --include is broken #23396

politza opened this issue Jun 17, 2022 · 5 comments · Fixed by #23401

Comments

@politza
Copy link

politza commented Jun 17, 2022

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes.

Description

Using the --include option of the test command won't find any tests, if the workspace property is non empty.

🔬 Minimal Reproduction

ng new issue-app
cd issue-app
ng g lib issue-lib
ng test issue-lib --include '**/*.spec.ts'

🔥 Exception or Error


An unhandled exception occurred: Specified patterns: "**/*.spec.ts" did not match any spec files.

🌍 Your Environment





     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 14.0.2
Node: 16.14.2
Package Manager: npm 8.7.0 
OS: linux x64

Angular: 14.0.2
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1400.2
@angular-devkit/build-angular   14.0.2
@angular-devkit/core            14.0.2
@angular-devkit/schematics      14.0.2
@schematics/angular             14.0.2
ng-packagr                      14.0.2
rxjs                            7.5.5
typescript                      4.7.4
    

Anything else relevant?

The logic here seems to assume that sourceRoot is relative to root.

@alan-agius4 alan-agius4 self-assigned this Jun 20, 2022
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 20, 2022
…hen using `--include` option

Previously, we ammended the project source root to the source root which resulted in an invalid path.

Closes angular#23396
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 20, 2022
…hen using `--include` option

Previously, we amended the project source root to the source root which resulted in an invalid path.

Closes angular#23396
dgp1130 pushed a commit that referenced this issue Jun 21, 2022
…hen using `--include` option

Previously, we amended the project source root to the source root which resulted in an invalid path.

Closes #23396
dgp1130 pushed a commit that referenced this issue Jun 21, 2022
…hen using `--include` option

Previously, we amended the project source root to the source root which resulted in an invalid path.

Closes #23396

(cherry picked from commit 6677994)
@kshaw797
Copy link

@alan-agius4 , We are on angular 14.0.5 and ng test --include still does seem to work. Does this fix part of any upcoming release?

@alan-agius4
Copy link
Collaborator

@kshaw797, can you please provide the output of ng v?

@kshaw797
Copy link

@alan-agius4 , Attached is the screenshot of output of ng v

Screenshot 2022-07-18 at 2 05 51 AM

@alan-agius4
Copy link
Collaborator

With the versions installed the problem should have addressed.

If the problem still persists, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. You can use ng new repro-app to create a new project where you reproduce the problem.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants