From a861d3d313f302408c6d70e2fd2a26f9dcc7dab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Thu, 25 Jan 2024 10:31:46 +0100 Subject: [PATCH] Add should test for `callable` --- test/should.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/should.js b/test/should.js index 0da30610..adb94d94 100644 --- a/test/should.js +++ b/test/should.js @@ -337,6 +337,18 @@ describe('should', function() { }, "expected '' to be false") }); + it("callable", function () { + (function () {}).should.be.callable; + (async function () {}).should.be.callable; + (function* () {}).should.be.callable; + (async function* () {}).should.be.callable; + true.should.not.be.callable; + + err(function () { + "".should.be.callable; + }, "expected '' to be a callable function"); + }); + it('null', function(){ (0).should.not.be.null;