Skip to content

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

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

Closed
1 task done
Julien-Marcou opened this issue Jun 13, 2022 · 1 comment · Fixed by #23371
Closed
1 task done

Comments

@Julien-Marcou
Copy link
Contributor

Julien-Marcou commented Jun 13, 2022

🐞 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
@Julien-Marcou Julien-Marcou 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 Jun 14, 2022
alan-agius4 pushed a commit that referenced this issue Jun 15, 2022
…inimal` workspaces

Remove the `ng test` VS Code task and `npm test` VS Code launch configuration from the workspace
when building minimal workspaces.

Fixes #23360
alan-agius4 pushed a commit that referenced this issue Jun 15, 2022
…inimal` workspaces

Remove the `ng test` VS Code task and `npm test` VS Code launch configuration from the workspace
when building minimal workspaces.

Fixes #23360

(cherry picked from commit 7cbbf2f)
@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 Jul 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants