Answer the question
In order to leave comments, you need to log in
What to read/watch on code testing (JS)?
I have never done automated testing before. Now it seems like the realization has come that it’s time to start already ...
I googled a little, found out that there are many different frameworks, all sorts of TDD, BDD, IT, E2E, etc.
It seems like a popular framework for JS unit tests is mocha.
In general, advise materials in Russian for studying this topic, perhaps specifically on mocha.
Where to start studying this topic at all?
Answer the question
In order to leave comments, you need to log in
It's easy to get confused at first. The following helped me:
1) there are test runners (that is, utilities that run tests, in your question this is mocha) and "asserot" libraries - this is something like "assertions" that you will use in tests.
2) all unit tests are nothing more than testing some function for the fact that it will produce a result previously described (by you!) Figuratively: there is a function sum(a, b), you write some code like this:
import { sum } from './my-functions'
ожидаю, что sum(1,3) === 4
import { sum } from './my-functions'
import { should } from 'another-assert-library' // should в переводе "быть/являться"
ожидаю, что sum(1,3).should.be.eql(4) // ожидаю что sum(1,3) будет равно 4
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question