Saturday, January 27, 2018

JavaScript unit tests with Jasmine and Karma


Jasmine and Karma installation

npm install // Install all the packages from package.json

npm install --save-dev jasmine
npm install --save-dev karma
npm install --save-dev karma-jasmine karma-chrome-launcher

Installs Karma dependencies; replace with whatever you have installed, e.g. chrome, firefox, or ie.

ESLint Installation

Install ESLint

npm install eslint --save-dev

Command Line

For developement

node_modules\.bin\karma start

For Build System

node_modules\.bin\karma start --single-run

To produce ESLint json config file

node_modules\.bin/eslint --init

To lint a file

node_modules\.bin\eslint yourfile.js

Github Repo

git remote add origin
git remote -v
git push -u origin master

No comments:

Post a Comment