I'm using casper tester module, and I had this structure:
casper.start();
...(various then() and wait() calls)
casper.then(function(){
test.done();
});
casper.run();
Doing it that way appeared to work fine (except for an intermittent timer problem I've been trying to troubleshoot).
If I change the above the following, which is shown in the casper docs, and which I thought was basically the same:
casper.start();
...(various then() and wait() calls)
casper.run(function(){
test.done();
});
then I get "WARN Looks like you didn't run any test.". I realized it was because I didn't have any assert()
calls yet! I added a gratuitous assert and the warning went away, and now I start getting a report of how many tests run, etc. (The intermittent timer problem remains, so that must be something else.)
But it made me realize that I should've been doing it the second way, and that obviously there is a difference.
Can somebody explain what the difference is, and why the first was not working correctly? I'm hoping it will lead to a deeper understanding of how CasperJS tests work!