Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweak flaky module-imports test #66728

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
expectUnsupportedModuleDevError,
expectUnsupportedModuleProdError,
getUnsupportedModuleWarning,
getModuleNotFound,
} from './utils'

jest.setTimeout(1000 * 60 * 2)
Expand Down Expand Up @@ -296,14 +297,29 @@ describe('Edge runtime code with imports', () => {
stderr: true,
})
expect(stderr).toContain(getUnsupportedModuleWarning(moduleName))
context.app = await nextStart(
context.appDir,
context.appPort,
appOption
)
const res = await fetchViaHTTP(context.appPort, url)

let logs = { stdout: '', stderr: '' }
const port = await findPort()

const options = {
onStdout(msg) {
logs.output += msg
logs.stdout += msg
},
onStderr(msg) {
logs.output += msg
logs.stderr += msg
},
}

await nextStart(context.appDir, port, options)
const res = await fetchViaHTTP(port, url)
expect(res.status).toBe(200)
expectNoError(moduleName)

expect(logs.output).not.toContain(
getUnsupportedModuleWarning(moduleName)
)
expect(logs.output).not.toContain(getModuleNotFound(moduleName))
})
}
)
Expand Down
Loading