Permalink
Browse files

disabled or irrelevant tests

Basically just some things I don't want to lose
  • Loading branch information...
isaacs committed Feb 22, 2012
1 parent 93d46ec commit 0ec97664df2494d710d8e047797c94473be4c159
Showing with 53 additions and 0 deletions.
  1. +36 −0 test-disabled/bailout.js
  2. +1 −0 test-disabled/foo.js
  3. +16 −0 test-disabled/t.js
View
@@ -0,0 +1,36 @@
+var tap = require("tap")
+ , test = tap.test
+
+test("bailout test", { skip: false }, function (t) {
+
+ // t.once("bailout", function () {
+ // console.error("bailout event")//, t)
+ // t.clear()
+ // })
+
+ // t.once("end", function () {
+ // console.error("end event")
+ // })
+
+ // simulate three tests where the second bails out.
+ t.test("first", function (t) {
+ t.pass("this is ok")
+ t.end()
+ })
+
+ t.test("bailout", function (t) {
+ console.error("bailout test")
+ t.pass("pass")
+ t.bailout("bail out message")
+ t.fail("fail")
+ t.end()
+ })
+
+ t.test("second (should not happen)", function (t) {
+ t.fail("this should not happen")
+ t.end()
+ })
+
+ t.end()
+
+})
View
@@ -0,0 +1 @@
+process.stdin
View
@@ -0,0 +1,16 @@
+var test = require('tap').test;
+
+function foo() {
+ throw new Error('one');
+}
+
+test('demonstrate bug in t.throws', function (t) {
+ t.throws(
+ function () {
+ foo();
+ },
+ new Error('two')),
+ // "this should throw",
+ // {}); // not 'one'!
+ t.end();
+});

0 comments on commit 0ec9766

Please sign in to comment.