Giter Site home page Giter Site logo

examples-3's Introduction

Examples of tests

All examples assume you have node and npm, and you know what is it.

First do in root of repo:

npm i

Most simple way - include all script's

Look in simple-mocha-should directory to look on most basic way to run tests with mocha and should. To repeat such steps:

Assume you in project folder

//if it is not inited before, provide some answers
npm init

// install dependencies
npm i --save-dev mocha should

./node_modules/.bin/mocha init folder_with_browser_tests

This will create basic structure you can see in simple-mocha-should, now you need to add script tags for should before your tests (mocha will add tests.js file by default). That is all, simple and practically useless. //if it is not inited before, provide some answers To run this example run npm run browser and open http://localhost:8080/simple-mocha-should/index.html

The same simple way but load tests with requirejs

In this example we load everything with requirejs, you can see simple-mocha-should-requirejs to understand how it works.

To run this example run npm run browser and open http://localhost:8080/simple-mocha-should-requirejs/index.html

Build test scripts with browserify

To run build of tests npm run build in folder browserify-mocha-should and then run as before:

npm run browser and open http://localhost:8080/browserify-mocha-should/index.html

Adding zuul

zuul allow automatically build tests in bundle and have good integration with sauce-labs. But you still need locally open each browser by hands for tests

Launch browsers with karma

Karma allow to run browser (also it sauce labs integration). All configuration happen in karma.conf.js files. To run tests just npm test.

karma-browserify-mocha-should contain example of using browserify to bundle files.

karma-requirejs-mocha-should contain example of using requirejs to load files

examples-3's People

Contributors

btd avatar

Watchers

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