Giter Site home page Giter Site logo

simple-testing-angularjs-with-jasmine-karma's Introduction

Simple-Testing-AngularJS-with-Jasmine-Karma

simple testing AngularJS application by using Jasmine and Karma

Make sure you have NodeJs install in your computer

Setup

nvm use 5.0

npm install

node server.js

Test

npm install -g karma-cli

karma start

About this program

The simple angular application aims to use Jasmin and Karma to test all the javascript code are working properly.

This application displays several users' information such as: id name role location twitter favorite Pokemon

once click the username, it will display an avatar of each user's favorite Pokémon on their individual profile page using Pokéapi API.

Testing

There are 14 test case and all the test case passed

Test the controller and a service that hits a real API. In my service tests, I utilized $httpBackend to listen to HTTP endpoints and $q to resolve or reject our expected responses from the API. Test the controllers with all of its dependencies including the tested services. Given that the users can have valid or invalid favorite Pokémon names. Finally learned did test the logic within our controller. I did this using multiple controller instances within our tests each with their own resolvedUser.

simple-testing-angularjs-with-jasmine-karma's People

Contributors

zhurui1322 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.