Table of Contents

Javascript - Test

About

Testing with Javascript.

Testing in Javascript is really dependent on which type of engine you test will be running. ie:

Side effects in javascript testing = DOM manipulations

Approach:

report through the console: you execute tests via a command line or with an IDE plugin. The browser is captured and used to execute the code, but does not show results: it sends them back (via Ajax ??). The execution can be started out of the browser

Process: writing inline event handlers is much easier than using the DOM APIs to bind those events but move those inline events to distinct scripts, either on the same page or even in a separate JavaScript file.

Headless testing

See: Web - Headless browser (Test automation)

test spies, stubs and mocks

http://sinonjs.org/ (for test setup).

where:

Code coverage

https://github.com/gotwarlost/istanbul