Junit report not showing test cases - junit

I'm using karma with jasmine and followed online guide by installing using
npm install --save-dev karma
and other necessities.
This is my karma config file.
module.exports = function(config) {
config.set({
frameworks: ['jasmine'],
plugins: [
require('karma-jasmine'),
require('karma-junit-reporter'),
"karma-chrome-launcher",
"karma-jasmine-html-reporter",
],
files: [
{ pattern: 'src/app/app.component.spec.ts', included: false,type :'js' },
// 'src/**/*.spec.ts',
// 'src/**/*.js'
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
// list of files / patterns to exclude
exclude: [
],
junitReporter: {
outputDir: '.',
outputFile: 'unit-test-result.xml',
useBrowserName: false
},
reporters: ['progress', 'kjhtml', 'junit'],
port: 9876,
colors: true,
logLevel: config.LOG_DEBUG,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
concurrency: Infinity
})
}
Some unit test cases are written in src/app/app.component.spec.ts file.
Junit Reporter is not writing the test cases in "unit-test-result.xml" file.
When I run "ng test" command the output comes as below
https://stackoverflowteams.com/c/neha/images/s/71deb22e-bb5f-44a2-84f2-5b4247db87c3.png
Now when I run "Karma Start" command , output comes as below
https://stackoverflowteams.com/c/neha/images/s/019ecb01-71ee-4c67-bbbf-02a2f1a1d581.png
No error shown in debug log, it shows statement as below
Chrome 109.0.0.0 (Windows 10): Executed 0 of 0 SUCCESS (0 secs / 0 secs)
and my "unit-test-result.xml" file generated with no test cases in it.
https://stackoverflowteams.com/c/neha/images/s/fe7a2dc7-7cd7-44c6-b7f3-c0eedf066e7c.png
Expected Output : I want my unit-test-result.xml to show 4 unit test cases.
my package.json is as below
{
"name": "angulat-test",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test --watch=false"
},
"private": true,
"dependencies": {
"#angular-devkit/build-angular": "^15.1.2",
"#angular/animations": "^15.1.0",
"#angular/common": "^15.1.0",
"#angular/compiler": "^15.1.0",
"#angular/core": "^15.1.0",
"#angular/forms": "^15.1.0",
"#angular/platform-browser": "^15.1.0",
"#angular/platform-browser-dynamic": "^15.1.0",
"#angular/router": "^15.1.0",
"karma-junit-reporter": "^2.0.1",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.12.0"
},
"devDependencies": {
"#angular/cli": "~15.1.2",
"#angular/compiler-cli": "^15.1.0",
"#types/jasmine": "~4.3.0",
"#types/node": "^18.11.18",
"jasmine-core": "~4.5.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"karma-typescript-preprocessor": "^0.4.0",
"typescript": "~4.9.4"
}
}
My tsconfig.spec.json
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"include": [
"src/app/app.component.spec.ts"
]
}
I am new to angular, any help would be highly appreciated.
Let me know if any more information is required.

Related

Is a version incompatibility preventing my Angular CLI animations from working?

I have a project to do. The Angular project was already set up when I started working. However, the animations do not seem to work properly. When I put a mat input placeholder, the placeholder doesn't disappear when I start writing in it. When I put a mat-select, the select doesn't drop down.
There's my package.json:
{
"name": "projetwifi-dashboard",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"serve": "ng serve --configuration=dev",
"start": "node server.js",
"build": "ng build",
"build:dev": "ng build --prod --configuration=dev",
"build:accept": "ng build --prod --configuration=accept",
"build:prod": "ng build --prod --configuration=production",
"test": "ng test",
"test:ci": "ng test --code-coverage=true --watch=false",
"lint": "ng lint && prettier -l \"**/*.ts\"",
"lint-fix": "ng lint --fix && prettier \"**/*.ts\" --write",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "~10.2.0",
"#angular/cdk": "^12.0.0",
"#angular/common": "~10.2.0",
"#angular/compiler": "^10.2.5",
"#angular/core": "~10.2.0",
"#angular/forms": "~10.2.0",
"#angular/material": "^10.2.7",
"#angular/platform-browser": "~10.2.0",
"#angular/platform-browser-dynamic": "~10.2.0",
"#angular/router": "~10.2.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"express-prom-bundle": "^6.2.0",
"googleapis": "^74.2.0",
"prom-client": "^12.0.0",
"puppeteer": "^5.4.1",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.1002.3",
"#angular/cli": "~10.2.0",
"#angular/compiler-cli": "^10.2.5",
"#types/jasmine": "~3.5.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.0.2"
}
}
I have tried many version of the dependencies but nothing seems to resolve the problem. Any ideas? Thanks
welcome to the SO community! In order to answer your question, I'm gonna have to take a guess, since you didn't provide us with a minimum reproducible example.
Usually, in order for angular animations to work, you have to include BrowserAnimationsModule as stated by the documentation.
Here's how I would do that:
import { NgModule } from '#angular/core';
import { BrowserModule } from '#angular/platform-browser';
import { BrowserAnimationsModule } from '#angular/platform-browser/animations';
#NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule
],
declarations: [ ],
bootstrap: [ ]
})
export class AppModule { }
Once you have that, you'll be able to work with Angular animations. Please use the link above to see how it fully works, but essentially, my hunch is that you didn't include this module and hence, your animations don't work. The guide I've given is the official Angular documentation, and it should help you get started.

"Live Broadcast" message on HTML5 audio player in Safari - Angular 6 Progressive Web App

I have a Progressive Web App in Angular 6 that includes an audio HTML5 tag to play some sounds. I deploy it to Firebase.
The problem I have is in Safari Browser (Mobile and Desktop, latest versions). Somehow the Service Worker makes that a "Live Broadcast"
message appears on the rendered audio tag when you try to play the sound (or even before you try to click on play button).
I don't get this "error" in Chrome, only in Safari.
I published an example app so that you can see the problem (remember
to visit the app from a Safari browser).
Example Firebase App
In this repository you can find the code of the example app.
Example App code repository
The "Live broadcast" message is something like this: Live Broadcast
message in Safari
I need that users can play the audio without getting that "Live Broadcast" text on the HTML5 audio player. I think it is something related with the Service Worker configuration, I'm not sure though. It might be an Angular problem too.
Any help would be really appreciated.
Details
Versions:
Angular version: 6.0.1
angular/cli version: 6.0.1
Node version: 8.11.1
npm version: 5.6.0
To build the app I use: (If I don't use --prod option I don't get the "Live Broadcast" message because the service worker is not
included when you don't use it)
ng build --prod
app.component.html
<div height="300px;">
<audio controls #audio123 controlsList="nodownload"
src="https://firebasestorage.googleapis.com/v0/b/angular-ng-build-
safari.appspot.com/o/-%20GIN%20-%20Testing%20Lakewood%20M31-CP%20(online-audio-converter.com).mp3?alt=media&token=1ba5f53e-58d3-43fe-b058-a6de05a51c29" preload="metadata">
</audio>
</div>
app.module.ts
import { BrowserModule } from '#angular/platform-browser';
import { NgModule } from '#angular/core';
import { AppComponent } from './app.component';
import { ServiceWorkerModule } from '#angular/service-worker';
import { environment } from '../environments/environment';
#NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production })
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
package.json
{
"name": "ng-build-sw-problem",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "^6.0.0",
"#angular/common": "^6.0.0",
"#angular/compiler": "^6.0.0",
"#angular/core": "^6.0.0",
"#angular/forms": "^6.0.0",
"#angular/http": "^6.0.0",
"#angular/platform-browser": "^6.0.0",
"#angular/platform-browser-dynamic": "^6.0.0",
"#angular/pwa": "^0.6.1",
"#angular/router": "^6.0.0",
"core-js": "^2.5.4",
"rxjs": "^6.0.0",
"zone.js": "^0.8.26",
"#angular/service-worker": "^6.0.0"
},
"devDependencies": {
"#angular/compiler-cli": "^6.0.0",
"#angular-devkit/build-angular": "~0.6.1",
"typescript": "~2.7.2",
"#angular/cli": "~6.0.1",
"#angular/language-service": "^6.0.0",
"#types/jasmine": "~2.8.6",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1"
}
}
ngsw-conf.json
{
"index": "/index.html",
"assetGroups": [{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
]
}
}]
}

Angular6 rxjs 6 update

Hi I appreciate these are a pain.
After updating Angular to version 6 and rxjs to version 6 we are getting a lot of browser errors that the system is unable to instantiate a number of packages.
We use a combination of node_modules and systemjs.config.server.js
without trying to start an argument on whether one is better than the other, If there are any improvements please let me know.
package.json
{
"version": "1.0.0",
"name": "infrastructure-annual-reporting",
"private": true,
"dependencies": {
"#angular/animations": "^6.0.0",
"#angular/cdk": "^6.0.0",
"#angular/common": "^6.0.0",
"#angular/compiler": "^6.0.0",
"#angular/core": "^6.0.0",
"#angular/forms": "^6.0.0",
"#angular/http": "^6.0.0",
"#angular/material": "^6.0.1",
"#angular/platform-browser": "^6.0.0",
"#angular/platform-browser-dynamic": "^6.0.0",
"#angular/router": "^6.0.0",
"angular-date-value-accessor": "^0.0.2",
"bootstrap": "^3.3.7",
"core-js": "^2.5.6",
"hammerjs": "^2.0.8",
"ng2-bs3-modal": "^0.13.0",
"ngx-accordion": "^0.0.17",
"nodemailer": "^4.6.4",
"rxjs": "^6.1.0",
"rxjs-compat": "^6.1.0",
"rxjs-tslint": "^0.1.3",
"socks": "^2.2.0",
"systemjs": "^0.21.3",
"web-animations-js": "^2.3.1",
"zone.js": "^0.8.26"
},
"devDependencies": {
"#angular/cli": "^6.0.0",
"#angular/language-service": "^6.0.0",
"#types/hammerjs": "^2.0.35",
"#types/jasmine": "^2.8.7",
"#types/node": "^10.0.6",
"codelyzer": "^4.3.0",
"jasmine": "^3.1.0",
"karma": "^2.0.2",
"lite-server": "^2.3.0",
"lodash": "^4.17.10",
"protractor": "^5.3.1",
"ts-node": "^6.0.3",
"tslint": "^5.10.0",
"typescript": "^2.8.3"
},
"keywords": [],
"license": "MIT",
"peerDependencies": {
"#angular/core": ">=2.0.0",
"#angular/common": ">=2.0.0",
"#angular/compiler": ">=2.0.0",
"#angular/platform-browser": ">=2.0.0",
"#angular/platform-browser-dynamic": ">=2.0.0",
"#angular/cdk": "6.0.1"
},
"repository": {},
"scripts": {
"build": "tsc -p src/",
"build:watch": "tsc -p src/ -w",
"build:e2e": "tsc -p e2e/",
"serve": "lite-server -c=bs-config.json",
"serve:e2e": "lite-server -c=bs-config.e2e.json",
"prestart": "npm run build",
"start": "concurrently \"npm run build:watch\" \"npm run serve\"",
"pree2e": "npm run build:e2e",
"e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first",
"preprotractor": "webdriver-manager update",
"protractor": "protractor protractor.config.js",
"pretest": "npm run build",
"test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"",
"pretest:once": "npm run build",
"test:once": "karma start karma.conf.js --single-run",
"lint": "tslint ./src/**/*.ts -t verbose"
}
}
systemjs.config.server.js
(function (global) {
// map tells the System loader where to look for things
var paths = {
'npm:': "https://unpkg.com/"
};
var map = {
'app': "app", // 'dist',
'#angular': "node_modules/#angular",
'angular2-in-memory-web-api': "node_modules/angular2-in-memory-web-api",
'rxjs': "npm:rxjs",
'#angular/platform-browser/animations': "npm:#angular/platform-browser/bundles/platform-browser-animations.umd.min.js",
"ngx-accordion": "npm:ngx-accordion#0.0.17/index.js",
'#angular/common/http': "npm:#angular/common/bundles/common-http.umd.js",
'#angular/animations/browser': "npm:#angular/animations#5.2.10/bundles/animations-browser.umd.js",
'ng2-bs3-modal': "npm:ng2-bs3-modal/bundles/ng2-bs3-modal.umd.js",
'hammerjs':"npm:hammerjs/hammer.js",
// CDK individual packages
'#angular/cdk/bidi': "npm:#angular/cdk/bundles/cdk-bidi.umd.js",
'#angular/cdk/platform': "npm:#angular/cdk/bundles/cdk-platform.umd.js",
'#angular/cdk/keycodes': "npm:#angular/cdk/bundles/cdk-keycodes.umd.js",
'#angular/cdk/collections': "npm:#angular/cdk/bundles/cdk-collections.umd.js",
'#angular/cdk/portal': "npm:#angular/cdk/bundles/cdk-portal.umd.js",
'#angular/cdk/coercion': "npm:#angular/cdk/bundles/cdk-coercion.umd.js",
'#angular/cdk/overlay': "npm:#angular/cdk/bundles/cdk-overlay.umd.js",
'#angular/cdk/accordion': "npm:#angular/cdk/bundles/cdk-accordion.umd.js",
'#angular/cdk/observers': "npm:#angular/cdk/bundles/cdk-observers.umd.js",
'#angular/cdk/layout': "npm:#angular/cdk/bundles/cdk-layout.umd.js",
'#angular/cdk/scrolling': "npm:#angular/cdk/bundles/cdk-scrolling.umd.js",
'#angular/cdk/table': "npm:#angular/cdk/bundles/cdk-table.umd.js",
'#angular/cdk/stepper': "npm:#angular/cdk/bundles/cdk-stepper.umd.js",
'#angular/cdk/a11y': "npm:#angular/cdk/bundles/cdk-a11y.umd.js",
'#angular/cdk/tree' : "node_modules/#angular/cdk#6.0.1/tree",
'tslib': "npm:tslib/tslib.js",
'rxjs/operators' : "npm:rxjs/operators/"
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': { main: "main.js", defaultExtension: "js" },
'rxjs': { defaultExtension: "js" },
'rxjs-compact': { defaultExtension: "js" },
'angular2-in-memory-web-api': { main: "index.js", defaultExtension: "js" }
};
var ngPackageNames = [
"animations",
"common",
"compiler",
"core",
"forms",
"http",
"material",
"platform-browser",
"platform-browser-dynamic",
"router"
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages["#angular/" + pkgName] = { main: "index.js", defaultExtension: "js" };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages["#angular/" + pkgName] = { main: "bundles/" + pkgName + ".umd.js", defaultExtension: "js" };
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = {
paths: paths,
map: map,
packages: packages
};
System.config(config);
})(this);
the errors that we are seeing in the browser are
in cmd : npm install rxjs-compat#6 --save
in systemjs.config :
packages: {
app: {
defaultExtension: 'js',
meta: {
'./*.js': {
loader: 'systemjs-angular-loader.js'
}
}
},
main_angular_upgrade:{
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js', main: "index.js"
},
"rxjs-compat": { defaultExtension: 'js', main: "index.js" },
"rxjs/operators": { "main": "index.js", "defaultExtension": "js" },
"rxjs/internal-compatibility": { "main": "index.js", "defaultExtension": "js" },
"rxjs/testing": { "main": "index.js", "defaultExtension": "js" },
'rxjs/ajax': { main: 'index.js', defaultExtension: 'js' },
'rxjs/webSocket': { main: 'index.js', defaultExtension: 'js' }
}
Follow this official guidance to properly update your angular project:
https://update.angular.io/
You just need to select which version you are migrating from and your package manager (npm/yarn).
Then you'll have a list of things to do or check in order to have all set.
update check list

BabelJs over Heroku: Couldn't find preset "env" relative to directory "/app"

I have an application with SailsJs over NodeJs on Heroku and I can't run babeljs on. It runs ok on my localhost, but I always get the error:
Error: Couldn't find preset "env" relative to directory "/app"
The Heroku persists in look for itens at /app folder. This project does not have one /app folder
My app folders structure is:
app_name
- api
- assets
- config
- tasks
- views
I follow the documentation of http://babeljs.io to my .babelrc
.babelrc
now:
{
"presets": ["react", "env", "stage-1"],
"plugins": ["transform-class-properties"]
}
Already tried:
{
"presets": ["react", "es2015", "stage-1"],
"plugins": ["transform-class-properties"]
}
When I set the .babelrc to use es2015 I get the error:
Invalid:
`{ presets: [{option: value}] }`
Valid:
`{ presets: [['presetName', {option: value}]] }`
I already installed the dependencies
npm install babel-preset-es2015
npm install babel-preset-react
npm install babel --save-dev
My package.json
{
"name": "redux-cardeck",
"private": true,
"version": "0.0.1",
"engines": {
"node": "6.11.4"
},
"description": "a Sails-Redux application for multi-player online card game",
"keywords": [
"sailsjs",
"redux",
"es2015",
"webpack"
],
"dependencies": {
"axios": "^0.13.1",
"babel-cli": "^6.26.0",
"babel-plugin-transform-class-properties": "^6.11.5",
"babel-plugin-transform-object-rest-spread": "^6.6.5",
"babel-polyfill": "^6.7.2",
"babel-preset-stage-1": "^6.13.0",
"connect-mongo": "0.8.2",
"css-loader": "^0.23.1",
"ejs": "2.3.4",
"file-loader": "^0.8.5",
"grunt": "0.4.5",
"grunt-babel": "^6.0.0",
"grunt-contrib-clean": "0.6.0",
"grunt-contrib-coffee": "0.13.0",
"grunt-contrib-concat": "0.5.1",
"grunt-contrib-copy": "0.5.0",
"grunt-contrib-cssmin": "0.9.0",
"grunt-contrib-jst": "0.6.0",
"grunt-contrib-less": "1.1.0",
"grunt-contrib-uglify": "0.7.0",
"grunt-contrib-watch": "0.5.3",
"grunt-sails-linker": "~0.10.1",
"grunt-sync": "0.2.4",
"include-all": "~0.1.6",
"node-sass": "^3.8.0",
"postcss-modules-extract-imports": "^1.0.0",
"postcss-modules-scope": "^1.0.0",
"rc": "1.0.1",
"react": "^0.14.9",
"react-dom": "^0.14.9",
"react-redux": "^4.4.8",
"react-router": "^2.6.1",
"react-tap-event-plugin": "^0.2.2",
"redux": "^3.7.2",
"redux-form": "^5.3.2",
"redux-optimist": "0.0.2",
"redux-optimistic-ui": "^0.3.2",
"redux-promise": "^0.5.3",
"redux-thunk": "^2.1.0",
"redux-undo": "^0.6.1",
"sails": "~0.12.1",
"sails-disk": "~0.10.9",
"sails-hook-babel": "^6.0.1",
"sails-mongo": "^0.12.2",
"sails-postgresql": "^0.11.4",
"sails-service-mailer": "^3.2.1",
"sails-webpack": "^1.0.13",
"sass": "^0.5.0",
"sass-loader": "^3.2.3",
"style-loader": "^0.13.1",
"unexpected-react": "^1.0.0",
"updeep": "^0.16.1",
"url-loader": "^0.5.7"
},
"scripts": {
"debug": "node debug app.js",
"start": "./node_modules/.bin/babel-node app.js"
},
"main": "app.js",
"repository": {
"type": "git",
"url": "git://github.com/vanphuong12a2/redux-cardeck.git"
},
"author": "phuong",
"license": "",
"devDependencies": {
"axios-mock-adapter": "^1.6.1",
"babel-cli": "^6.26.0",
"babel-core": "^6.7.2",
"babel-loader": "^6.4.1",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"css-modules-require-hook": "^4.0.0",
"jsdom": "^8.1.0",
"react-tools": "^0.13.3",
"redux-devtools": "^3.4.0",
"redux-logger": "^2.6.1",
"source-map": "^0.5.3",
"unexpected": "^10.10.8",
"webpack-dev-server": "^1.14.1"
}
}
Someone already used BabelJs on Heroku before? I can't understand why it cant find babeljs at the package.json. I set the local of babel on heroku as
"scripts": {
"debug": "node debug app.js",
"start": "./node_modules/.bin/babel-node app.js"
},
I think it could be a problem with the relative structure of heroku or the fact I do not have a folder with name app
Thanks if someone can help me with this.
By default Heroku doesn't install the dependencies listed on "devDependencies" in your package.json.
You can either move your presets to "dependencies" or follow the steps here to alter this behavior.

Angular2 bundle.js:2 Uncaught ReferenceError: google is not defined

I use the 2.0.0-rc.4 version of Angular. I have always "google is not defined" problem in my console
console error
bundle.js:2 Uncaught ReferenceError: google is not defined
With Angular Beta without gulp, I have not had the problem.
typings folder content
my ** gulpfile.js** file
var gulp = require('gulp');
gulp.task('bundle', function() {
var SystemBuilder = require('systemjs-builder');
var builder = new SystemBuilder();
builder.loadConfig('./system.config.js')
.then(function(){
var outputFile = 'dist/bundle.js';
return builder.buildStatic('app', outputFile, {
minify: true,
mangle: true,
rollup: true
});
})
.then(function(){
console.log('bundle built successfully!');
});
});
package.json
{
"name": "angular2-poc",
"scripts": {
"clean": "gulp clean",
"compile": "gulp compile",
"build": "gulp build",
"postinstall": "typings install",
"test": "tsc && karma start",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"start": "concurrent \"npm run tsc:w\" \"npm run lite\" ",
"typings": "typings"
},
"devDependencies": {
"concurrently": "^1.0.0",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-jshint": "^2.0.1",
"gulp-minify": "0.0.11",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.3.1",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"jasmine-core": "~2.3.4",
"jshint": "^2.9.2",
"karma": "~0.13.15",
"karma-jasmine": "~0.3.6",
"karma-phantomjs2-launcher": "^0.3.2",
"lite-server": "2.0.1",
"path": "^0.12.7",
"systemjs-builder": "^0.15.16",
"traceur": "^0.0.91",
"typescript": "^1.7.3",
"yargs": "^4.7.0"
},
"dependencies": {
"#angular/common": "2.0.0-rc.4",
"#angular/compiler": "2.0.0-rc.4",
"#angular/core": "2.0.0-rc.4",
"#angular/http": "2.0.0-rc.4",
"#angular/platform-browser": "2.0.0-rc.4",
"#angular/platform-browser-dynamic": "2.0.0-rc.4",
"#angular/router": "3.0.0-beta.1",
"#angular/upgrade": "2.0.0-rc.4",
"#angular/forms": "0.2.0",
"es6-shim": "^0.35.0",
"events": "^1.0.2",
"fbjs": "^0.3.1",
"flux": "^2.1.1",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.27",
"zone.js": "^0.6.12"
}
}
My tsd.json file
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"googlemaps/google.maps.d.ts": {
"commit": "de82425735f84a10b43921ae4b1d085b3752a626"
}
}
}
Thanks you
Try loading these 2 files from your index.html
<script src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
For more details, refer this - https://developers.google.com/chart/interactive/docs/basic_load_libs
See if this helps.