angular-cli

ng test --code-coverage not printing coverage details

不羁岁月 提交于 2020-12-13 04:03:09
问题 When I run the tests using ng test --code-coverage I get the code coverage as unknown, not sure what might be going wrong. Any help here is appreciated. > ng test --code-coverage 10% building modules 1/1 modules 0 active26 06 2018 11:00:51.088:WARN [karma]: No captured browser, open http://localhost:9876/ 26 06 2018 11:00:51.095:INFO [karma]: Karma v2.0.0 server started at http://0.0.0.0:9876/ 26 06 2018 11:00:51.095:INFO [launcher]: Launching browser Chrome with unlimited concurrency 26 06

Using environment variables in nx based nodejs app

混江龙づ霸主 提交于 2020-12-12 02:53:37
问题 I've setup a project with several nodejs and angular apps inside a nrwl/nx workspace. I'm trying to work with the environment files inside the nodejs apps. I've setup the import like this: import {environment} from './environments/environment'; Then I ran ng serve my-node-app and it shows the environment for non production. Now I tried to do ng serve my-node-app --prod to see how the app works with a production setup - but I get the error: Configuration 'production' could not be found in

Generate production build with sourcemaps in Angular - CLI

江枫思渺然 提交于 2020-12-11 05:55:06
问题 How to keep sourcemaps after production build? Right now, my command looks like this: "build-prod": "ng build --app=release -prod && cp -R lang dist" I tried changing it to: ng build --app=release --sourceMap=true -prod && cp -R lang dist but nothing changed. If I do: ng build --sourcemap I get sourcemaps but then I get index.html instead of index.prod.html. Is it possible to edit the first command to build sourcemap files? this is my tsconfig.json file: { "compileOnSave": false,

Angular CLI - 'Cannot find module' when using custom library created with 'ng new library'

最后都变了- 提交于 2020-12-08 07:59:19
问题 I'm trying to consume my own library after creating it with the Angular CLI using ng new library lib-name . I'm trying to import the library as documented, this way: import {MyLibModule} from 'ngx-mylib'; But I get the following error: error TS2307: Cannot find module 'ngx-mylib'. I did ng build ngx-mylib and also verified my tsconfig.json has the following paths (which are added automatically using the CLI): "paths": { "ngx-mylib": [ "dist/ngx-chartjs" ], "ngx-mylib/*": [ "dist/ngx-chartjs/*

How to disable or bypass MSAL authentication when running Angular e2e tests?

回眸只為那壹抹淺笑 提交于 2020-12-06 07:03:05
问题 I want to set up some end to end tests for my Angular application, which requires the use of the MSAL library to authenticate with some downstream services. When I try to run my e2e tests locally, the MSAL library is forcing me to authenticate with a username/password. This is a problem because our CI/CD e2e testing should not have any human-intervention; thus I am looking for a way to either bypass the MSAL authentication or set up a service-account to login. Unfortunately there is not a lot

How to resolve “Function calls are not supported in decorators but 'StoreModule' was called.”

て烟熏妆下的殇ゞ 提交于 2020-12-04 05:02:21
问题 I've an angular (7) project. In my package.json, I've a command defined: { "name": "xxx", "version": "0.1.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "build-prod": "ng build --prod", "test": "ng test", "test-ci": "ng test --no-watch --no-progress --browsers=ChromeHeadlessNoSandbox", "e2e-ci": "ng e2e --protractor-config=e2e/protractor.conf.js", "deploy": "firebase deploy --token $FIREBASE_TOKEN --non-interactive", "lint": "ng lint", "e2e": "ng e2e" }, [...] } When I

How to resolve “Function calls are not supported in decorators but 'StoreModule' was called.”

和自甴很熟 提交于 2020-12-04 05:00:14
问题 I've an angular (7) project. In my package.json, I've a command defined: { "name": "xxx", "version": "0.1.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "build-prod": "ng build --prod", "test": "ng test", "test-ci": "ng test --no-watch --no-progress --browsers=ChromeHeadlessNoSandbox", "e2e-ci": "ng e2e --protractor-config=e2e/protractor.conf.js", "deploy": "firebase deploy --token $FIREBASE_TOKEN --non-interactive", "lint": "ng lint", "e2e": "ng e2e" }, [...] } When I

Angular CLI app not running when deploying to Linux App Service

戏子无情 提交于 2020-12-01 07:45:34
问题 I'm trying to deploy an Angular CLI app to Azure App Service on Linux OS, using Azure Dev Ops - but no success. I get Image 1. No error in the server or application logs. This is what I done so far: Built the Angular CLI app using DevOps Build and placed the resulted "dist" folder to the "drop" folder. See below (Image 2) the tasks that compose my build. This is working fine and creating the expected files. Created a release in DevOps, deploying all the dist files in the wwwroot folder in the

Is not core-js needed anymore?

时间秒杀一切 提交于 2020-11-24 10:39:45
问题 I've updated an Angular project from version 7 to 8. Everything runs smoothly, schematics did it's job (maybe) and we are Ok (project is even in production). When we're updating Angular CLI, we always generate a new project to see the real differences and learn from them such as new dependencies, configurations, etc. When generating a new Angular project with Angular CLI 8.0.4, the new app doesn't have core-js as dependency: "dependencies": { "@angular/animations": "~8.0.1", "@angular/common"

Is not core-js needed anymore?

本秂侑毒 提交于 2020-11-24 10:31:11
问题 I've updated an Angular project from version 7 to 8. Everything runs smoothly, schematics did it's job (maybe) and we are Ok (project is even in production). When we're updating Angular CLI, we always generate a new project to see the real differences and learn from them such as new dependencies, configurations, etc. When generating a new Angular project with Angular CLI 8.0.4, the new app doesn't have core-js as dependency: "dependencies": { "@angular/animations": "~8.0.1", "@angular/common"