From 41d8b466b72cc63cae7146334f34c1998c5d8e71 Mon Sep 17 00:00:00 2001 From: Pavel Murygin Date: Tue, 23 Nov 2021 11:41:54 +0300 Subject: [PATCH] Fix timeout error message --- src/__test__/unit/builtInHandler.spec.ts | 4 ++-- src/internal/defaultServices.ts | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/__test__/unit/builtInHandler.spec.ts b/src/__test__/unit/builtInHandler.spec.ts index 50cb49433..105fe7238 100644 --- a/src/__test__/unit/builtInHandler.spec.ts +++ b/src/__test__/unit/builtInHandler.spec.ts @@ -33,8 +33,8 @@ describe('Tests for default handler', () => { ${'peer'} | ${'timeout'} | ${[200, []]} | ${0} | ${[]}} ${'peer'} | ${'timeout'} | ${[200, ['test']]} | ${0} | ${['test']}} - ${'peer'} | ${'timeout'} | ${[]} | ${1} | ${'timeout accepts exactly two arguments: timeout duration in ms and an optional message string'}} - ${'peer'} | ${'timeout'} | ${[200, 'test', 1]} | ${1} | ${'timeout accepts exactly two arguments: timeout duration in ms and an optional message string'}} + ${'peer'} | ${'timeout'} | ${[]} | ${1} | ${'timeout accepts exactly two arguments: timeout duration in ms and a message string'}} + ${'peer'} | ${'timeout'} | ${[200, 'test', 1]} | ${1} | ${'timeout accepts exactly two arguments: timeout duration in ms and a message string'}} `.test( // diff --git a/src/internal/defaultServices.ts b/src/internal/defaultServices.ts index 2f19ffc71..b33c45a35 100644 --- a/src/internal/defaultServices.ts +++ b/src/internal/defaultServices.ts @@ -101,9 +101,7 @@ export const defaultServices: { [serviceId in string]: { [fnName in string]: Gen peer: { timeout: (req) => { if (req.args.length !== 2) { - return error( - 'timeout accepts exactly two arguments: timeout duration in ms and an optional message string', - ); + return error('timeout accepts exactly two arguments: timeout duration in ms and a message string'); } const durationMs = req.args[0]; const message = req.args[1];