From 58ef707bc6ad9e67a911e56426502544ebc09021 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Wed, 17 Mar 2021 17:58:51 -0700 Subject: [PATCH] Added jasmine.isSpy to the public interface * Fixes #1880 --- lib/jasmine-core/jasmine.js | 8 ++++++++ src/core/base.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 93cf9a75..f96e205c 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -512,6 +512,14 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { return new j$.SetContaining(sample); }; + /** + * Determines whether the provided function is a Jasmine spy. + * @name jasmine.isSpy + * @since 2.0.0 + * @function + * @param {Function} putativeSpy - The function to check. + * @return {Boolean} + */ j$.isSpy = function(putativeSpy) { if (!putativeSpy) { return false; diff --git a/src/core/base.js b/src/core/base.js index 5ff9441e..3c1da322 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -344,6 +344,14 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { return new j$.SetContaining(sample); }; + /** + * Determines whether the provided function is a Jasmine spy. + * @name jasmine.isSpy + * @since 2.0.0 + * @function + * @param {Function} putativeSpy - The function to check. + * @return {Boolean} + */ j$.isSpy = function(putativeSpy) { if (!putativeSpy) { return false;