diff --git a/src/SetupApi.ts b/src/SetupApi.ts index 100fa4c29..e5415b31a 100644 --- a/src/SetupApi.ts +++ b/src/SetupApi.ts @@ -41,7 +41,7 @@ export abstract class SetupApi { invariant( !Array.isArray(handler), devUtils.formatMessage( - 'Failed to call "%s" given an Array of request handlers. Make sure you spread the request handlers when calling this function.', + 'Failed to construct "%s" given an Array of request handlers. Make sure you spread the request handlers when calling the respective setup function.', ), this.constructor.name, ) diff --git a/test/msw-api/setup-server/input-validation.test.ts b/test/msw-api/setup-server/input-validation.test.ts index e63799cc8..01c64a5be 100644 --- a/test/msw-api/setup-server/input-validation.test.ts +++ b/test/msw-api/setup-server/input-validation.test.ts @@ -14,6 +14,6 @@ test('throws an error given an Array of request handlers to setupServer', async } expect(createServer).toThrow( - `[MSW] Failed to call "SetupServerApi" given an Array of request handlers. Make sure you spread the request handlers when calling this function.`, + `[MSW] Failed to construct "SetupServerApi" given an Array of request handlers. Make sure you spread the request handlers when calling the respective function.`, ) }) diff --git a/test/msw-api/setup-worker/input-validation.test.ts b/test/msw-api/setup-worker/input-validation.test.ts index 933d1ba57..fc6869974 100644 --- a/test/msw-api/setup-worker/input-validation.test.ts +++ b/test/msw-api/setup-worker/input-validation.test.ts @@ -16,7 +16,7 @@ test('throws an error given an Array of request handlers to "setupWorker"', asyn expect(exceptions).toEqual( expect.arrayContaining([ expect.stringContaining( - '[MSW] Failed to call "SetupWorkerApi" given an Array of request handlers. Make sure you spread the request handlers when calling this function.', + '[MSW] Failed to construct "SetupWorkerApi" given an Array of request handlers. Make sure you spread the request handlers when calling the respective function.', ), ]), )