You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 https://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.
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
About
Some examples of using should.js with mocha and various tools for node.js and browser tests