hardchor / front-tests

An exemple how to test your front with mocha and phantomjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An exemple how to test your front with mocha and phantomjs

Install phantomjs http://phantomjs.org/

Serve the exemple folder using pushState (use serve-filirom1)

$ serve -P exemple

Run the phantomjs script:

$ phantomjs run-mocha.js http://127.0.0.1:3000

It will print this following output:

Array
  #push()
    ✓ should append a value

    ✓ should return the length


Array
  #pop()
    ✓ should remove and return the last value

    ✓ should adjust .length


Test web
  ✓ should print `Hey guy` when clicking on link toto



✔ 5 tests complete (650ms)

Test it in a browser

Serve the exemple folder using pushState (use serve-filirom1)

$ serve -P exemple

Then inside your browser run the following command:

> mocha.run();

Thanks

This project is mainly inspired, copied from:

About

An exemple how to test your front with mocha and phantomjs


Languages

Language:JavaScript 100.0%