narwhal-test.js 600 B

12345678910111213141516171819202122
  1. // Run with: $ narwhal test/narwhal-test.js
  2. var QUnit = require("../qunit/qunit");
  3. QUnit.log(function(details) {
  4. if (!details.result) {
  5. var output = "FAILED: " + (details.message ? details.message + ", " : "");
  6. if (details.actual) {
  7. output += "expected: " + details.expected + ", actual: " + details.actual;
  8. }
  9. if (details.source) {
  10. output += ", " + details.source;
  11. }
  12. print(output);
  13. }
  14. });
  15. QUnit.test("fail twice with stacktrace", function(assert) {
  16. /*jshint expr:true */
  17. assert.equal(true, false);
  18. assert.equal(true, false, "gotta fail");
  19. x.y.z; // Throws ReferenceError
  20. });