P
P
pxx2012-11-28 15:51:24
JavaScript
pxx, 2012-11-28 15:51:24

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

2 answer(s)
P
Pavel Tyslyatsky, 2012-11-28
@tbicr

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.

D
dhomich, 2012-12-03
@dhomich

Have a look at " Test-Driven JavaScript Development "

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question