Skip to content

Creating new application without testing framework does not generate correct .vscode files #23360

Closed

Description

@Julien-Marcou

🐞 Bug report

Command (mark with an x)

  • new

Is this a regression?

No

Description

When generating a new Angular project without the tests (--skip-tests --minimal), Angular CLI generates a .vscode folder with incorrect JSON configurations for the tests that are not present on the project.

🔬 Minimal Reproduction

ng new demo --skip-tests --minimal

❌ Current behavior

Here are the generated files:

.vscode/launch.json

{
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "ng serve",
      "type": "pwa-chrome",
      "request": "launch",
      "preLaunchTask": "npm: start",
      "url": "http://localhost:4200/"
    },
    {
      "name": "ng test",
      "type": "chrome",
      "request": "launch",
      "preLaunchTask": "npm: test",
      "url": "http://localhost:9876/debug.html"
    }
  ]
}

.vscode/task.json

{
  // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
  "version": "2.0.0",
  "tasks": [
    {
      "type": "npm",
      "script": "start",
      "isBackground": true,
      "problemMatcher": {
        "owner": "typescript",
        "pattern": "$tsc",
        "background": {
          "activeOnStart": true,
          "beginsPattern": {
            "regexp": "(.*?)"
          },
          "endsPattern": {
            "regexp": "bundle generation complete"
          }
        }
      }
    },
    {
      "type": "npm",
      "script": "test",
      "isBackground": true,
      "problemMatcher": {
        "owner": "typescript",
        "pattern": "$tsc",
        "background": {
          "activeOnStart": true,
          "beginsPattern": {
            "regexp": "(.*?)"
          },
          "endsPattern": {
            "regexp": "bundle generation complete"
          }
        }
      }
    }
  ]
}

✔ Expected behavior

I should have these generated files instead:

.vscode/launch.json

{
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "ng serve",
      "type": "pwa-chrome",
      "request": "launch",
      "preLaunchTask": "npm: start",
      "url": "http://localhost:4200/"
    }
  ]
}

.vscode/task.json

{
  // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
  "version": "2.0.0",
  "tasks": [
    {
      "type": "npm",
      "script": "start",
      "isBackground": true,
      "problemMatcher": {
        "owner": "typescript",
        "pattern": "$tsc",
        "background": {
          "activeOnStart": true,
          "beginsPattern": {
            "regexp": "(.*?)"
          },
          "endsPattern": {
            "regexp": "bundle generation complete"
          }
        }
      }
    }
  ]
}

🌍 Your Environment

Angular CLI: 14.0.1
Node: 16.15.1
Package Manager: npm 8.12.1

Activity

  1. changed the title [-]Creating new application without test does not generate correct .vscode files[/-] [+]Creating new application without testing framework does not generate correct .vscode files[/+] on Jun 14, 2022
  2. added
    freq1: lowOnly reported by a handful of users who observe it rarely
    good first issueLabel noting a good first issue to be worked on by a community member
    help wantedLabel noting an issue which the team is looking for contribution from the community to fix
    on Jun 14, 2022
  3. added 2 commits that reference this issue on Jun 15, 2022
    7cbbf2f
    5a486cb
  4. angular-automatic-lock-bot commented on Jul 16, 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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @schematics/angularfreq1: lowOnly reported by a handful of users who observe it rarelygood first issueLabel noting a good first issue to be worked on by a community memberhelp wantedLabel noting an issue which the team is looking for contribution from the community to fixseverity2: inconvenienttype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions