mirror of
https://github.com/hanzoai/msw.git
synced 2026-09-24 17:00:34 +00:00
16 lines
476 B
TypeScript
16 lines
476 B
TypeScript
import { vi } from 'vitest'
|
|
|
|
/**
|
|
* @note The list of standard Node.js modules missing
|
|
* in the React Native runtime.
|
|
*/
|
|
const reactNativeMissingModules = ['events', 'node:events']
|
|
|
|
reactNativeMissingModules.forEach((moduleName) => {
|
|
vi.doMock(moduleName, () => {
|
|
throw new Error(
|
|
`Failed to import module "${moduleName}": it does not exist in React Native. This likely means MSW tries to import something too optimistically in that environment.`,
|
|
)
|
|
})
|
|
})
|