How to install Karma manually? - karma-runner

I have installed Nodejs.
But I want to install Karma manully for some reason.
And there is no instruction in Karma's home page http://karma-runner.github.io/0.10/index.html

This installs karma globally:
npm install -g karma

Related

Ionic and cordova(Latest versions) installation problems

I'm trying to install the Ionic framework with npm. It successfully installed. But when I try installing new versions of Ionic and Cordova, I was unable to install and Error messages are coming frequently in the ubuntu terminal.
I had a same problem but i recovered it using following command:
npm install -g cordova ionic --verbos
if its not work then you need to try yarn. you can download and install form https://yarnpkg.com/lang/en/docs/install/ this website
After install, run the following command
yarn add global cordova
yarn add global ionic

How to verify facebook jest is installed successfully

I followed the instructions to install Facebook jest on https://facebook.github.io/jest/docs/getting-started.html#content :
npm install --save-dev jest-cli
After the install command I typed jest in the terminal, and press enter but It popped:
bash: jest: command not found.
But when I run the getting started sample by using npm test in the terminal, it worked well.
So, how can I verify that Facebook jest is installed successfully?
Ways to install a package in npm
In node.js you have two ways to install a package: globally or locally.
The sintax is the following:
// globally
npm install -g [package_name]
// locally
npm install --save-dev [package_name]
So, now what it happens is that you run the local one which downloads the package in node_modules under your project folder.
To check you installed jest properly so you can check on your node_modules if there is a jest folder.
How to check if jest is installed
In addition to that npm is creating a shortcut in you local node_modules under the directory .bin son in there you should find a link to jest.
You can test that like that:
cd your_project_folder
./node_modules/.bin/jest
Why npm test works?
The reason why npm test works is because when you run it npm is going to look for the commands globally and locally.

How to use sinon on karma?

I'm trying to use karma, chai and sinon to test spy.
I did:
npm install karma-sinon --save-dev
I added:
frameworks: ['mocha','chai','chai-sinon']
I run:
karma start
But I'm getting this error:
Error: No provider for "framework:chai-sinon"! (Resolving: framework:chai-sinon)
I had the same problem by simply adding the chai entry to the Frameworks section of my karma.conf.js script did not solve the problem. Following this Github Issue I found that you need to install the karma-cli globally, and everything else can be local and work.
npm install --save-dev karma
npm install -g karma-cli
npm install --save-dev karma-phantomjs-launcher karma-chai karma-sinon
During going through PluralSight course on Gulp I've come into the same problem.
This issue was due to lack of npm modules that are required. The string that helped me is this:
npm install --save-dev karma karma-chai karma-chai-sinon karma-chrome-launcher karma-coverage karma-growl-reporter karma-mocha karma-phantomjs-launcher karma-sinon mocha mocha-clean sinon-chai sinon phantomjs
Initially I've misspelled the karma-chai-sinon as karma-chai sinon so it successfully installed every dependency but resulted in the error.
So please try it. I've got the same error.
Did you add the 'karma-chai-sinon' to your plugins in your karma.conf.js
My plugins looks like this:
plugins: [ 'karma-chai-sinon', 'karma-mocha', 'karma-phantomjs-launcher', 'karma-babel-preprocessor' ]
I've had the same problem by simply adding the chai entry to the Frameworks section of my karma.conf.js script did not solve the problem, it's the same other frameworks that you point into frameworks array.
Have you installed the "karma-sinon-chai" npm package
Have you tried it?
e.g. npm install karma-simon-chai --dev-save

ember-cli ignores my coffeescript test files

I'm an ember-cli newbie and I'm trying to start testing my dumb app with some dumb tests. It seems that ember-cli ignores any *test.js.coffee files in tests directory.
I'm using version 0.0.44 and installed coffescript adapter with npm install --save-dev ember-cli-coffeescript
Any idea why?
Did you install the coffeescript module?
npm install --save-dev ember-cli-coffeescript

How to install protractor and start it?

I followed instructions in the document on how to install protractor and selenium and I am unable to start.
install -g protractor
webdriver-manager update
After that I tried
webdriver-manager start and I got an error
events.jst:72
throw er; // Unhandeled 'error event
Error: spawn ENOENT
at errnoException (child_projcess.js:980:11)
at Process.ChildProcess.handle.onexeit (childprocess.js:771:34)
If I do webdriver-manager status I get this
selenium standalone is up to date
chromedriver is up to date
IEDriver is not present
What is going on?
Looks like you are running on the mac platform.
Installing it globally as you are doing, installs it to the system's node_module folder. You should try and install it locally for the project as its a project dependency.
so run:
npm install protractor
Kind of old, but what solved it for me was to install java:
In an Ubuntu system:
sudo apt-get install openjdk-7-jre
In Fedora:
sudo yum install java-1.8.0-openjdk
Keep hacking!
First install globally npm i -g protractor
Secondly install locally npm i protractor