You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
On adding test frameworks their peerDependencies are not installed #2283
Only occurs when the user has installed globally npm version 3.x. The difference between npm 2.x and 3.x is that, npm 2.x installs all peer-dependencies of a package and npm 3.x does not.
Example: lets install the following package with package.json like:
So if we do: npm install some-dependency --save with npm 2.x, peer-dep-1 will be installed, but if we do the same with npm 3.x peer-dep-1 will not be installed. This happens, because npm 3.x does not install the peer-dependencies.
Possible solutions
Forcefully install the peer dependencies of all packages when using tns init command. When doing it with npm 2.x, nothing will happen.
Add missing peer dependency to tns init command (harder to maintain)
fix in package (move from peer-dependency to dependency)
@Plamen5kov how about leaving the responsibility of installing dev peer dependencies to the developer? Messages output by npm are verbose enough where peer dependencies are concerned.
I think that after seeing the message about the unmet peer dependency -its clear what you have to do. However, it would be great to update the docs with a note that you will have to manually add a dependency based on the testing framework you choose. It would help people who just follow the guide.
@Pip3r4o moving peer-dependecy to dependency is out of our reach, as it is the karma-jamine package that has the peer-dep.
Activity
Plamen5kov commentedon Nov 30, 2016
Problem
Only occurs when the user has installed globally npm version 3.x. The difference between npm 2.x and 3.x is that, npm 2.x installs all peer-dependencies of a package and npm 3.x does not.
Example: lets install the following package with
package.jsonlike:So if we do:
npm install some-dependency --savewith npm 2.x,peer-dep-1will be installed, but if we do the same with npm 3.xpeer-dep-1will not be installed. This happens, because npm 3.x does not install the peer-dependencies.Possible solutions
tns initcommand. When doing it with npm 2.x, nothing will happen.tns initcommand (harder to maintain)peer-dependencytodependency)petekanev commentedon Nov 30, 2016
@Plamen5kov how about leaving the responsibility of installing dev peer dependencies to the developer? Messages output by npm are verbose enough where peer dependencies are concerned.
NickIliev commentedon Nov 30, 2016
related to #2212 (comment)
vakrilov commentedon Mar 8, 2017
I think that after seeing the message about the unmet peer dependency -its clear what you have to do. However, it would be great to update the docs with a note that you will have to manually add a dependency based on the testing framework you choose. It would help people who just follow the guide.
@Pip3r4o moving
peer-dependecytodependencyis out of our reach, as it is thekarma-jaminepackage that has the peer-dep.dtopuzov commentedon Apr 25, 2017
#2693 fix
jasminandqunitsuccessfully, but you still need to manually installmocha.Add tests for NativeScript/nativescript-cli#2283
dtopuzov commentedon Apr 25, 2017
CLI is now adding peer dependencies, but the problem is that
mochais not longer peer dependency.May be we should close the issue add some notes here:
https://docs.nativescript.org/tooling/testing#configure-your-project
rosen-vladimirov commentedon Apr 26, 2017
I believe the
$ tns test initcommand should provide a project that's ready for writing tests, without the need to install any dependencies additionally. We can improve our logic here:https://github.com/NativeScript/nativescript-cli/blob/master/lib/commands/test-init.ts#L7-L9
https://github.com/NativeScript/nativescript-cli/blob/master/lib/commands/test-init.ts#L32-L33
To add the required depdendencies (as
mocha).NickIliev commentedon May 15, 2018
The issue is still reproducible .. running
is failing with