Unverified Commit 5781401d authored by Alex Kirszenberg's avatar Alex Kirszenberg Committed by GitHub

misc: Apply PR comments from #49206 (#49647)

This PR applies suggestions from @jridgewell's review of
https://github.com/vercel/next.js/pull/49206
parent 1a867bbb
......@@ -255,7 +255,10 @@ export async function changeFile(
replaceWith: string
) {
return new Promise((resolve, reject) => {
const id = unsafeUniqueId()
let id
while ((id = unsafeUniqueId())) {
if (!fileChangedResolvers.has(id)) break
}
fileChangedResolvers.set(id, { resolve, reject })
......
......@@ -228,6 +228,10 @@ async fn run_test(resource: PathBuf) -> JsResult {
let package_root = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let tests_dir = package_root.join("tests");
let integration_tests_dir = tests_dir.join("integration");
// We run tests from a temporary directory because tests can modify files in the
// test directory when testing the file watcher/HMR, and we have no reliable way
// to ensure that we can restore the original state of the test directory after
// running the test.
let resource_temp: PathBuf = tests_dir.join("temp").join(
resource
.strip_prefix(integration_tests_dir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment