-
Notifications
You must be signed in to change notification settings - Fork 0
TDD
UNDER CONSTRUCTION
This page describes a setup suited for TDD, using Eclipse JSDT and Chrome Development Tools for remote debugging.
-
Download Eclipse, for example the Eclipse IDE for JavaScript Web Developers
-
Install 'Eclipse EGit', from
http://download.eclipse.org/egit/updates -
Install all in 'Google Chrome Developer Tools', from
http://chromedevtools.googlecode.com/svn/update/dev/ -
Install 'JS Test Driver', from
http://js-test-driver.googlecode.com/svn/update/ -
Optional, install 'm2e - Maven integration for Eclipse', from
http://download.eclipse.org/technology/m2e/releases/. This requires the JDT feature.
Use Import wizard
- Import Project > Git > Projects from Git > URI
- git://github.com/frawa/TestCodeMirror2.git
- select only 'master' branch
- import as General project
In the Script Explorer, right click the new project and select 'Configure > Convert to JavaScript project'
In 'Window > Preferences', point 'JS Test Driver' to your browsers' executable files.
- Open the 'jsTestDriver' view, using 'Window > Show View ...' menu.
- Start the server
- Do not connect Chrome browser yet.
You will find several useful launch configurations in test/launch/ folder.
This will connect Chrome to the jsTestDriver server, ready for remote debugging. Basically, this launch configuration invokes chrome with these arguments
--remote-debugging-port=9222 --user-data-dir=remote-profile http://127.0.0.1:42442/capture
This one connects Eclipse to Chrome for debugging.
It has brings two important configuration peaces
- On the 'Remote' tab: Only short filenames are used
- On the 'Source' tab: A JavaScript Source Name Mapper. The TestCodeMirror2 project is added.
NOTE There is currently a bug in chromedevtools. It is fixed on trunk, but was not yet released. For now, you will have to run Eclipse with local build of the debugger, see HowToBuild for details.
This ones launches tests as configured by test/jsTestDriver.conf file.
You will use the 'Rerun last configuration' button during your TDD cycles.
We are all set up.