Skip to content

Commit

Permalink
chore: adjust invalid handlers signature message
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Nov 7, 2022
1 parent 5cff8f1 commit 8f72804
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/SetupApi.ts
Expand Up @@ -41,7 +41,7 @@ export abstract class SetupApi<EventsMap extends EventMapType> {
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,
)
Expand Down
2 changes: 1 addition & 1 deletion test/msw-api/setup-server/input-validation.test.ts
Expand Up @@ -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 setup function.`,
)
})
2 changes: 1 addition & 1 deletion test/msw-api/setup-worker/input-validation.test.ts
Expand Up @@ -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 setup function.',
),
]),
)
Expand Down

0 comments on commit 8f72804

Please sign in to comment.