Skip to content

ng test --include is broken #23396

Closed

Description

@politza

🐞 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.

Activity

  1. self-assigned this
    on Jun 20, 2022
  2. added 2 commits that reference this issue on Jun 20, 2022
    3524f0b
    f1c574b
  3. added 2 commits that reference this issue on Jun 21, 2022
    6677994
    5e960ce
  4. kshaw797 commented on Jul 18, 2022

    @kshaw797

    @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?

  5. alan-agius4 commented on Jul 18, 2022

    @alan-agius4
    Collaborator

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

  6. kshaw797 commented on Jul 18, 2022

    @kshaw797

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

    Screenshot 2022-07-18 at 2 05 51 AM

  7. alan-agius4 commented on Jul 18, 2022

    @alan-agius4
    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.

  8. angular-automatic-lock-bot commented on Aug 18, 2022

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions