From f69d3397ea370793094261daa769aa893bdd74b1 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 29 Mar 2023 09:44:49 -0300 Subject: test: emit right error when no calls expected --- test/lib/generic-mock.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/lib') diff --git a/test/lib/generic-mock.js b/test/lib/generic-mock.js index 2a34644..119f873 100644 --- a/test/lib/generic-mock.js +++ b/test/lib/generic-mock.js @@ -219,7 +219,7 @@ export function mockFunction(...args) { } else if (expectedCallCount === 1) { topLevelErrors.push(new Error(`Expected 1 call, got ${totalCallCount}`)); } else { - topLevelErrors.push(new Error(`Unexpectedly called at all`)); + topLevelErrors.push(new Error(`Expected no calls, got ${totalCallCount}`)); } } @@ -246,7 +246,7 @@ export function mockFunction(...args) { // No further processing, this indicates the function shouldn't have been // called at all and there aren't any descriptions to match this call with. if (empty(allCallDescriptions)) { - return; + return newCallDescription(); } const currentCallNumber = runningCallCount; -- cgit 1.3.0-6-gf8a5