Skip to content
An exemple how to test your front with mocha and phantomjs
JavaScript
Find file
Pull request Compare This branch is 19 commits behind Filirom1:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
exemple
lib
README.md
run-mocha.js

README.md

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:

Something went wrong with that request. Please try again.