diff --git a/test/exposed-harness.js b/test/exposed-harness.js index fc375c29..53a2dd92 100644 --- a/test/exposed-harness.js +++ b/test/exposed-harness.js @@ -6,7 +6,11 @@ var tap = require('tap'); tap.test('main harness object is exposed', function (tt) { tt.equal(typeof tape.getHarness, 'function', 'tape.getHarness is a function'); + tt.equal(typeof tape.run, 'function', 'tape.run is a function'); + tt.equal(tape.getHarness()._results.pass, 0); + tt.equal(tape.getHarness().run, undefined, 'tape.getHarness().run is undefined (wait not called)'); + tt.end(); }); diff --git a/test/wait.js b/test/wait.js new file mode 100644 index 00000000..a62012c4 --- /dev/null +++ b/test/wait.js @@ -0,0 +1,16 @@ +'use strict'; + +var tape = require('../'); +var tap = require('tap'); + +tap.test('tape.wait()', function (tt) { + tt.equal(typeof tape.getHarness, 'function', 'tape.getHarness is a function'); + + tt.equal(typeof tape.run, 'function', 'tape.run is a function'); + + tape.wait(); + + tt.equal(typeof tape.getHarness().run, 'function', 'tape.getHarness().run is a function (wait called)'); + + tt.end(); +});