D
D
Dmitry2015-03-03 14:27:08
JavaScript
Dmitry, 2015-03-03 14:27:08

UNIT testing of JavaScript code for beginners, is it real?

Good day to all readers!
There is such initial data: there is some JavaScript code in a vacuum, it has errors.
There is such a task: Some JavaScript code with errors must be subjected to unit testing (testing of all functions).
Well, now the actual question: how to do it? No, of course, I'm not a fool and even more, I can read and see the search bar perfectly, and I even studied all the pages in the search results, but as a beginner in this matter, I'm interested in the full cycle, for example, open a file, write something and this, connect this.
It is clear that there are no such guides, but for a beginner who has never dealt with this at all, compare information from different sources about Jasmine, Grunt & etc. very difficult.
I don’t expect someone to write such an article or do everything for me, I just would like to find a person who has gone through this difficult path and could help with advice on how and what to do. Well, if there are such materials in the world, then I will be grateful for the proof.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Kitmanov, 2015-03-03
@k12th

A small project with unit tests , in package.json you can see how they run, and in the test folder, the actual tests.

U
Uncle_Bill, 2017-03-11
@Uncle_Bill

First, a lot of famous JS projects on GitHub have tests, look at them.
Secondly, choose a framework with which you will write tests.
Try starting with QUnit: Introduction to Unit Testing .
Article for beginners: Unit Testing JavaScript in PhpStorm .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question