fix: tests running with local API imported from the payload package instead of the HMR from the next package

This commit is contained in:
Paul Popus
2024-03-13 18:00:41 -03:00
parent 5c2bcba000
commit 171144be80
2 changed files with 3 additions and 4 deletions

View File

@@ -64,7 +64,7 @@ export const getPayloadHMR = async (options: InitOptions): Promise<Payload> => {
try {
cached.payload = await cached.promise
if (process.env.NODE_ENV !== 'production') {
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
try {
const port = process.env.PORT || '3000'
const ws = new WebSocket(`ws://localhost:${port}/_next/webpack-hmr`)