I other to unit test my app, I’ve follow this Ionic 2 unit test tutorial.
When I run the command:
npm test
I have this output.
ng test
It seems like you're using a project generated using an old version of the Angular CLI.
The latest CLI now uses webpack and has a lot of improvements including a simpler
workflow, a faster build, and smaller bundles.
To get more info, including a step-by-step guide to upgrade the CLI, follow this link:
https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.14
npm ERR! Test failed. See above for more details.
Here is my config
package.json
“dependencies”: {
“@angular/common”: “2.2.1”,
“@angular/compiler”: “2.2.1”,
“@angular/compiler-cli”: “2.2.1”,
“@angular/core”: “2.2.1”,
“@angular/forms”: “2.2.1”,
“@angular/http”: “2.2.1”,
“@angular/platform-browser”: “2.2.1”,
“@angular/platform-browser-dynamic”: “2.2.1”,
“@angular/platform-server”: “2.2.1”,
“angular2-moment”: “^1.0.0-beta.rc.1”,
“moment”: “^2.16.0”,
“ng2-translate”: “^5.0.0”,
“socket.io-client”: “^1.5.1”,
“@ionic/storage”: “1.1.7”,
“ionic-angular”: “2.0.0”,
“ionic-native”: “2.4.1”,
“ionicons”: “3.0.0”,
“rxjs”: “5.0.0-beta.12”,
“zone.js”: “0.6.26”
},
“devDependencies”: {
“@ionic/app-scripts”: “latest”,
“@types/jasmine”: “^2.5.42”,
“@types/node”: “^7.0.5”,
“angular-cli”: “^1.0.0-beta.20-1”,
“codecov”: “^1.0.1”,
“jasmine-core”: “^2.5.2”,
“jasmine-spec-reporter”: “^3.2.0”,
“karma”: “^1.4.1”,
“karma-chrome-launcher”: “^2.0.0”,
“karma-jasmine”: “^1.1.0”,
“karma-mocha-reporter”: “^2.2.2”,
“karma-remap-istanbul”: “^0.6.0”,
“sw-toolbox”: “^3.4.0”,
“ts-node”: “^2.1.0”,
“tslint”: “^4.4.2”,
“tslint-eslint-rules”: “^3.3.0”,
“typescript”: “^2.0.3”