I am trying to setup the Angular2 project with unit tests. I am using this manual: http://twofuckingdevelopers.com/2016/01/testing-angular-2-with-karma-and-jasmine/ It is obviously outdated, because now default Angular2 npm package is @angular/*
The stated example doesn't work, because angular2 package is different. So I am re-mapping everything to that @angular package.
My package.json contains the following dependencies:
"dependencies": {
"@angular/common": "^2.0.0-rc.5",
"@angular/compiler": "^2.0.0-rc.5",
"@angular/core": "^2.0.0-rc.5",
"@angular/http": "^2.0.0-rc.5",
"@angular/platform-browser": "^2.0.0-rc.5",
"@angular/platform-browser-dynamic": "^2.0.0-rc.5",
"@angular/router": "^3.0.0-rc.1",
"@angular/router-deprecated": "^2.0.0-rc.2",
"@angular/upgrade": "^2.0.0-rc.5",
"es6-promise": "^3.2.1",
"es6-shim": "^0.35.1",
"reflect-metadata": "^0.1.2",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.17"
},
"devDependencies": {
"@angular/testing": "^0.0.0-0",
"concurrently": "^2.0.0",
"eslint": "^3.3.1",
"eslint-config-google": "^0.6.0",
"eslint-config-standard": "^6.0.0",
"eslint-plugin-promise": "^2.0.1",
"eslint-plugin-standard": "^2.0.0",
"jasmine-core": "2.4.1",
"karma": "^1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.0.2",
"lite-server": "^2.2.0",
"remap-istanbul": "^0.6.4",
"typescript": "^1.8.10",
"typings": "^1.0.4"
}
I deleted all node_packages folder to start from clean slate.
When running "npm install", I see the following output:
$ npm install
npm WARN package.json testing-from-twofuckingdevelopers.com@1.0.0 No description
npm WARN package.json testing-from-twofuckingdevelopers.com@1.0.0 No repository field.
npm WARN package.json testing-from-twofuckingdevelopers.com@1.0.0 No README data
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN peerDependencies The peer dependency @angular/core@0.0.0-0 included from @angular/testing will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency @angular/common@0.0.0-0 included from @angular/testing will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency @angular/compiler@0.0.0-0 included from @angular/testing will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency @angular/platform-browser@0.0.0-0 included from @angular/testing will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
|
> fsevents@1.0.14 install /Users/maris/Dropbox/Documents/Knowledge/Development/Angular2/testing-from-twofuckingdevelopers.com/node_modules/karma/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
[fsevents] Success: "/Users/maris/Dropbox/Documents/Knowledge/Development/Angular2/testing-from-twofuckingdevelopers.com/node_modules/karma/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> fsevents@1.0.14 install /Users/maris/Dropbox/Documents/Knowledge/Development/Angular2/testing-from-twofuckingdevelopers.com/node_modules/lite-server/node_modules/browser-sync/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
[fsevents] Success: "/Users/maris/Dropbox/Documents/Knowledge/Development/Angular2/testing-from-twofuckingdevelopers.com/node_modules/lite-server/node_modules/browser-sync/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package @angular/common@2.0.0-rc.5 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer @angular/platform-browser@2.0.0-rc.5 wants @angular/common@^2.0.0-rc.5
npm ERR! peerinvalid Peer @angular/platform-browser-dynamic@2.0.0-rc.5 wants @angular/common@^2.0.0-rc.5
npm ERR! peerinvalid Peer @angular/router@3.0.0-rc.1 wants @angular/common@^2.0.0-rc.5
npm ERR! peerinvalid Peer @angular/router-deprecated@2.0.0-rc.2 wants @angular/common@^2.0.0-rc
npm ERR! peerinvalid Peer @angular/testing@0.0.0-0 wants @angular/common@0.0.0-0
npm ERR! Please include the following file with any support request:
npm ERR! /Users/maris/Dropbox/Documents/Knowledge/Development/Angular2/testing-from-twofuckingdevelopers.com/npm-debug.log
What I should do to get it work? Or maybe you can suggest the tutorial that covers unit testing which works for most recent Angular2 version?