This repo contains runnable code examples showing how to use the Sandbox, Spy and Stub APIs in Sinon.js. It was used during parts 1 and 2 of the Sinon.js session for the YouView ASG Full Stack Workshop.
- Install Node and npm, e.g. by using nvm. N.B. Install a Node version of 8 or higher - this is due to the
async/awaitkeywords not being supported in lower versions. - Clone the GitHub repo by running:
git clone git@github.com:BenRoss92/sinon-workshop-examples.git - Change into the directory by running:
cd sinon-workshop-examples. - Install the dependencies by running:
npm install.
To run all of the test files in the test/ directory, run: npm test.
To run all of the test files in the test/ directory, as well as rerunning the tests whenever changes are made to either the test/ or src/ directories, run: npm run test:watch.
The slides can be found here - please see the 'Useful resources' slide for links to further guides. Please also note that the slides were purposely left minimal.
A recording of part 1 of the workshop can be found here
A recording of part 2 of the workshop can be found here.