question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Support for `ng test` in Angular CLI v6 via angular.json `test` `builder`

See original GitHub issue

In the new Angular CLI angular.json file you get this config which backs the ng test command:

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  ...
  "projects": {
    "my-app-name-here": {
      ...
      "architect": {
        ...
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "karmaConfig": "src/karma.conf.js",
            "styles": [
              "src/styles.css"
            ],
            "scripts": [],
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ]
          }
        },
        ...
      }
    },
    ...
    }
  },
  ...
}

Is it possible create a package similar to @angular-devkit/build-angular:karma (not sure about everything it does), and make it available for as a replacement for above?

Thanks for awesome project.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Itruliacommented, Jul 2, 2018

@ahnpnl this is different. the linked issue is about doing the boilerplate stuff, not overriding the angular cli test command 😃

0reactions
Itruliacommented, Sep 15, 2018

Hey! I have done something like this here: https://github.com/Itrulia/jest-schematic (as I wrote on 3rd of July I would, I am sorry, it took me a while).

I hope this helps you out!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng test - Angular
Option Description Value Type Defau... ‑‑browsers Override which browsers tests are run against. string ‑‑code‑coverage Output a code coverage report. boolean false ‑‑code‑coverage‑exclude Globs to exclude...
Read more >
Angular CLI builders
Angular provides some builders that are used by the CLI for commands such as ng build and ng test . Default target configurations...
Read more >
Testing - Angular
The Angular CLI downloads and installs everything you need to test an Angular application with Jasmine testing framework. ... The ng test command...
Read more >
Building and serving Angular apps
The Angular CLI build , serve , and test commands can then replace files with appropriate versions for your intended target environment. Configure...
Read more >
ng e2e - Angular
Builds and serves an Angular application, then runs end-to-end tests. ... One or more named builder configurations as a comma-separated list as specified...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found