HTML and CSS Reference
In-Depth Information
On subsequent runs, simply select Run As and then Name of configuration.
Even better, check the Run on every save checkbox in the configuration prompt.
This way, tests are run anytime a file in the project is saved, perfect for the test-driven
development process.
3.4.5 Improved Command Line Productivity
If the command line is your environment of choice, the Java command to run tests
quickly becomes a bit tiresome to type out. Also, it would be nice to be able to have
tests run automatically whenever files in the project change, just like the Eclipse
and IDEA plugins do. Jstdutil is a Ruby project that adds a thin command line
interface to JsTestDriver. It provides a leaner command to run tests as well as an
jsautotest command that runs related tests whenever files in the project change.
Jstdutil requires Ruby, which comes pre-installed on Mac OS X. For other
systems, installation instructions can be found on ruby-lang.org. With Ruby
installed, install Jstdutil by running `gem install jstdutil` in a shell.
Jstdutil uses the previously mentioned $JSTESTDRIVER _ HOME environment
variable to locate the JsTestDriver jar file. This means that running tests is a
simple matter of `jstestdriver --tests all` , or for autotest, simply
`jsautotest` . If the configuration file is not automatically picked up, spec-
ify it using `jstestdriver --config path/to/file.conf --tests
all` . The jstestdriver and jsautotest commands also add coloring to
the test report, giving us that nice red/green visual feedback.
3.4.6 Assertions
JsTestDriver supports a rich set of assertions. These assertions allow for highly
expressive tests and detailed feedback on failures, even when a custom assertion
message isn't specified. The full list of supported assertions in JsTestDriver is:
assert(msg, value)
assertTrue(msg, value)
assertFalse(msg, value)
assertEquals(msg, expected, actual)
assertNotEquals(msg, expected, actual)
assertSame(msg, expected, actual)
assertNotSame(msg, expected, actual)
assertNull(msg, value)
 
Search WWH ::




Custom Search