GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing javascript.info — What's wrong in the test? back to the lesson What's wrong in the test?importance: 5 What’s wrong in the test of
P.S. Syntactically the test is correct and passes. The test demonstrates one of the temptations a developer meets when writing tests. What we have here is actually 3 tests, but layed out as a single function with 3 asserts. Sometimes it’s easier to write this way, but if an error occurs, it’s much less obvious what went wrong. If an error happens in the middle of a complex execution flow, then we’ll have to figure out the data at that point. We’ll actually have to debug the test. It would be much better to break the test into multiple Like this:
We replaced the single Also we can isolate a single test and run it in standalone mode by writing
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |