Unit Test Flashcards

1
Q

What are unit tests?

A

A unit test is a way of testing a unit - the smallest piece of code that can be logically isolated in a system. In most programming languages, that is a function, a subroutine, a method or property.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is it important to write unit tests?

A

a good way to debug your code. Gives you tons of confidence when you refactor your code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What code should be tested with a unit test? What code is not well suited for unit tests?

A

a small unit is good to test. large blocks of code not good to test. use end-to-end testing for large blocks of code/applicatuib

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Jest? What are some other popular JavaScript unit testing frameworks?

A

Jest is a JavaScript testing framework designed to ensure correctness of any JavaScript codebase.
Other popular JavaScript testing frameworks are:
Mocha, Storybook, Jasmine, Cypress, Puppeteer, Ava, and a lot more!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly