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

misc: Apply PR comments from #49206 #49647

Merged
merged 4 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down