I've translated a bunch of unit tests from your python exercises into javascript unit tests. The goal of the assignment is the same as your other unit test based assignment: get green test output. Of course, with a new language comes new supporting tech. Instead of using pytest and pip, we are using jest and yarn. Your interaction with these tools will be minimal right now, but you will use them more as we start on projects using javascript.
To get started with this assignment you need to clone the repository.
After cloning, you run yarn install
to install the required dependencies.
This is a little different from how we've used pip
.
When we've used pip
, we've specifically pip install
ed a single package
for the entire system.
With yarn
each project installs its own dependencies and each project
keeps a list of what it needs to run.
So to start up, we only need to say yarn install
, and it will install
whatever is needed.
For this assignment, it should only need to install jest
.
After running yarn install
you should be able to say yarn test
.
For your workflow, I'd suggest keeping terminal and editor open side-by-side and
running yarn test --watch
. This command tells yarn to rerun your tests
anytime you save a file.
To test only one file you can run yarn test objects.test.js
and to test only
one group of tests inside a file you can run yarn test objects.test.js -t arrayToObject
.