Answer the question
In order to leave comments, you need to log in
Literature on javascript unit testing approaches?
We started implementing testing of javascript code in the project. I figured out the technical part, started using QUnit + Testswarm, in this aspect there seem to be no questions.
Questions of a different kind arise:
1. Methodology for javascript unit testing. The approaches used for server languages are not always applicable.
2. Many things in the code are tied to the interface. What's the best way to test things like this? Well, this is no longer pure unit testing, but also a bit of automation?
3. How to test scripts that appear somewhere on pages accessible after certain actions? For example, after logging in or purchasing a product.
4. Given the binding to interface things, i.e. to HTML, what is the best way to mock data and state for tests?
I would be grateful for any information.
Answer the question
In order to leave comments, you need to log in
I don’t know about the literature, but you can, for example, look at how the guys from jquery do: github.com/jquery/jquery/tree/master/test or on other trusted projects.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question