Permalink
Browse files

Continue running tests when an exception occurs.

  • Loading branch information...
reid committed Jan 7, 2010
1 parent 9274233 commit 12e4e29449bf2339e045088ddaa4a4b14276756a
Showing with 7 additions and 3 deletions.
  1. +7 −3 test/test.js
View
@@ -17,12 +17,16 @@ posix.readdir('.').addCallback(function (files) {
function load_haml(scope) {
file.read(haml_file).addCallback(function (haml) {
file.read(base + ".html").addCallback(function (expected) {
- var actual = Haml.render(haml, scope);
- if (actual !== expected) {
+ try {
+ var actual = Haml.render(haml, scope);
+ assert.equal(actual, expected);
+ } catch (e) {
+ var message = e.name;
+ if (e.message) message += ": " + e.message;
+ puts(message);
puts("Actual:\n" + actual);
puts("Expected:\n" + expected);
}
- assert.equal(actual, expected);
});
});
}

0 comments on commit 12e4e29

Please sign in to comment.