From 249b2b966a8807c50e07746ff04acb8c48fa4357 Mon Sep 17 00:00:00 2001 From: Martin d'Allens Date: Tue, 26 May 2020 20:29:07 +0200 Subject: [PATCH] Typo in loader.load() error message (#242) --- src/__tests__/abuse.test.js | 4 ++-- src/index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/__tests__/abuse.test.js b/src/__tests__/abuse.test.js index f2bb0dc..9300e80 100644 --- a/src/__tests__/abuse.test.js +++ b/src/__tests__/abuse.test.js @@ -36,7 +36,7 @@ describe('Provides descriptive error messages for API abuse', () => { // $FlowExpectError idLoader.load(); }).toThrow( - 'The loader.load() function must be called with a value,' + + 'The loader.load() function must be called with a value, ' + 'but got: undefined.' ); @@ -44,7 +44,7 @@ describe('Provides descriptive error messages for API abuse', () => { // $FlowExpectError idLoader.load(null); }).toThrow( - 'The loader.load() function must be called with a value,' + + 'The loader.load() function must be called with a value, ' + 'but got: null.' ); diff --git a/src/index.js b/src/index.js index f5f4e15..6250df9 100644 --- a/src/index.js +++ b/src/index.js @@ -74,7 +74,7 @@ class DataLoader { load(key: K): Promise { if (key === null || key === undefined) { throw new TypeError( - 'The loader.load() function must be called with a value,' + + 'The loader.load() function must be called with a value, ' + `but got: ${String(key)}.` ); }