Giter Site home page Giter Site logo

front-end-js-testing's Introduction

Front-end Javascript Testing

Goals:

  1. Unit testing
  2. Integrations testing

The libraries used for both of them have been kept as similar as possible to each other. In fact, only the runner library differs, but the framework and assertions libraries used are the same.

This module aims to be a reference/ starter for a testable front-end Javascript application.

Unit testing

Unit tests will need to test individual functions (white-box) using:

  • Runner: Karma
  • Framework: Mocha
  • Assertions: Chai Expect, Chai-as-promised

Individual functions will be required, and tested in isolation. This is white box testing, as we are concerned with the internal details of how each function works. Karma is used as the test runner rather than Mocha directly, because we need access browser functionality.

Integration testing

Integration tests will need to test entire application (black-box) using:

  • Runner: Webdriver.io
  • Framework: Mocha
  • Assertions: Chai Expect, Chai-as-promised

The entire application will be run, and tests will simulation actual usage of the web site. This is black box testing, as we are not concerned with the details of how the application works, just the end results. Webdriver.io is used as the test runner, rather than Mocha directly, because it is used to interface with a selenium server.

Author

Brendan Graetz

Licence

GPL-3.0

front-end-js-testing's People

Contributors

bguiz avatar boonhui-lai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

front-end-js-testing's Issues

400 Bad request

I get

400 Bad Request
'json' or 'msgpack' parameter is required

when running npm run integration-test the selenium server is running on another window so no worry from this side.
Do you know what is the problem?

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.