Spotify Radio - JS Expert Week 6.0
Welcome to the sixth Javascript Expert Week. This is the starting code to start our journey.
Tag this project with a star 🌟
Preview
Checklist Features
Tasks per class
- Lesson 01: Cover service and route layers with unit tests and achieve 100% code coverage
- Lesson 02: Maintain 100% code coverage and implement e2e tests for the entire API
- Lesson 03: implement unit tests for the frontend and maintain 100% code coverage
-
PLUS:
Source code for classes and solving challenges
Credits to the sources I've used on the demos
Streaming
Effects
FAQ
-
NODE_OPTIONS
is not a system recognized command, what to do?
- If you are on Windows, the way to create environment variables is different. You must use the word
set
before the command.
- Ex:
"test": "set NODE_OPTIONS=--experimental-vm-modules && npx jest --runInBand",
-
I ran npm test
but nothing happens, what to do?
- Check your Node.js version. We are using version 17. Go to node.js website and download the latest version.
-
jest.spyOn
- when we try to use function.name
(something like stream.pipe.name
), it says the instance is undefined
- In this case, use the value as a string:
jest.spyOn(stream, "pipe").mockReturnValue
-
Challenge 01 impossible to complete 100% code coverage because testUtil.js is not being fully used
- Add the following code snippet to the first line of the testUtil.js file:
/* istanbul ignore file */
. This will make jest ignore this file and complete 100%.
- Important: this change will only serve to complete this first and/or second challenge, in the last class, we will not need to ignore this file since we will use all the functions