From a7eff79db0ca62f37e04f57d8e1a7cc5b6040f0e Mon Sep 17 00:00:00 2001 From: Nito Buendia Date: Wed, 16 Mar 2022 21:26:59 +0800 Subject: [PATCH] Simplify test for arguments passed --- spec/core/matchers/toHaveSpyInteractionsSpec.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/core/matchers/toHaveSpyInteractionsSpec.js b/spec/core/matchers/toHaveSpyInteractionsSpec.js index 4b8982ed..2e1bfaff 100755 --- a/spec/core/matchers/toHaveSpyInteractionsSpec.js +++ b/spec/core/matchers/toHaveSpyInteractionsSpec.js @@ -41,14 +41,12 @@ describe('toHaveSpyInteractions', function() { }); }); - [['argument'], [false, 0]].forEach(function(testValue) { - it(`throws error if arguments (${testValue}) are passed`, function() { - let spyObj = jasmineUnderTest.getEnv().createSpyObj('NewClass', ['spyA', 'spyB']); + it('throws error if arguments are passed', function() { + let spyObj = jasmineUnderTest.getEnv().createSpyObj('NewClass', ['spyA', 'spyB']); - expect(function() { - expect(spyObj).toHaveSpyInteractions(...testValue); - }).toThrowError(Error, /Does not take arguments/); - }); + expect(function() { + expect(spyObj).toHaveSpyInteractions('an argument'); + }).toThrowError(Error, /Does not take arguments/); }); it('throws error if spy object has no spies', function() {