Giter Site home page Giter Site logo

surendravidiyala / karma-jasmine-testing Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 35.52 MB

unit testing in your Angular applications using Angular mocks, Karma, and Jasmine

HTML 61.56% JavaScript 34.83% CSS 3.61%
angularjs unit-testing karma-cli karma-jasmine karma-test-runner karma-preprocessor karma-config jasmine-tests jasmine-tests-angularjs

karma-jasmine-testing's Introduction

karma-jasmine-testing

  • unit testing in your Angular applications. You will learn about Angular mocks, Karma, and Jasmine and learn how to use them to carry out unit testing and e2e testing.
    • Configure a Karma configuration file and Set up unit tests using Jasmine and carry out the unit test automatically
    • Setting up the Unit Test Environment
  • First, set up Jasmine core to be available for use within your project:

install karma and karma-jasmine

npm install karma --save-dev
npm install jasmine-core --save-dev
  • Then, set up the Karma command line tools globally as follows:
     npm install karma-cli -g

Remember to use sudo if you are in OSX or Linux environments. Then set up karma-jasmine plugin to make use of Jasmine with Karma:

     npm install karma-jasmine --save-dev
  • In order to set up browser environments to carry out the tests, set up PhantomJS, and Karma launchers for PhantomJS and Chrome as follows:
     npm install phantomjs karma-phantomjs-launcher karma-chrome-launcher karma-edge-launcher  --save-dev
  • You can also set up for Firefox, IE and Safari if you use these browsers. Setting up Angular Mocks You should also install the ngMock module as follows:
     bower install angular-mocks -S

Unit Testing of MenuController Next, we will configure Karma to conduct the unit test. First, create a folder in conFusion folder, named test. Move to the test folder, and create a file named karma.conf.js there. This file will contain the configuration information for the Karma tests.

karma-jasmine-testing's People

Contributors

surendravidiyala avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.