From aa7de58f7d86eb07552ac6847ef575e057774ad1 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 11 Mar 2024 13:55:58 -0700 Subject: [PATCH] [Tests] increase coverage --- test/exposed-harness.js | 4 ++++ test/wait.js | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/wait.js 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(); +});