HTML and CSS Reference
In-Depth Information
15.1.1 Directory Structure
Again, we will use JsTestDriver to run the tests. The client will eventually use all
the code developed throughout Part III, Real-World Test-Driven Development in
JavaScript, but we will start with a bare minimum and add in dependencies as they
are required. For the TDD session, some of the dependencies will always be stubbed,
meaning we won't need them to develop the client. Listing 15.1 shows the initial
directory structure.
Listing 15.1 Initial directory structure
chris@laptop:~/projects/chat_client $ tree
.
| -- jsTestDriver.conf
| -- lib
| -- stub.js
| `-- tdd.js
| -- src
`-- test
stub.js contains the stubFn function from Chapter 13, Streaming Data with
Ajax and Comet, and tdd.js contains the tddjs object along with the various
tools built in Part II, JavaScript for Programmers, Listing 15.2 shows the contents
of the jsTestDriver.conf configuration file. As usual, you can download the
initial project state from the topic's website. 1
Listing 15.2 The initial JsTestDriver configuration
server: http://localhost:4224
load:
- lib/*.js
- src/*.js
- test/*.js
15.1.2 Choosing the Approach
Prior to launching the TDD session we need a general idea on how we're going
to build the client. Our main priorities are to keep a clear separation between the
DOM and the data (provided by cometClient from Chapter 13, Streaming Data
1. http://tddjs.com
 
Search WWH ::




Custom Search