I have started implementing TDD in my JS project. I've implemented mocha for that purpose. As these are my first steps what I did:
- Installed node.js
- Installed mocha globally and locally to my project.
- Wrote package.json setting dependencies.
- Wrote makefile.
- Wrote .gitignore to avoid uploading node_modules folder.
Folder structure
project
-- js ----filetotest.js
-- test ---- test.js
What I want to do is to run the command make test in order to run the tests inside test.js that tests the filetotest.js file. I read about the node.js approach using exports. But is there some way to include the file in the test suite?
I'm stuck here, and I think that my doubt is more about the concept than the tech thing. Will appreciate a lot your help.
To clarify a little bit what I would like to do: https://nicolas.perriault.net/code/2013/testing-frontend-javascript-code-using-mocha-chai-and-sinon/
I would like to get a similar result through the command line.
Thanks so much,
Guillermo