nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: karen-irc/option-t
Pull request #1293 (2022-05-19 16:54:10)

Use `node:fs/promises` instead of fs.promises


Patch:
diff --git a/tools/extension_renamer.mjs b/tools/extension_renamer.mjs
index afb5ed05..9e2a409c 100644
--- a/tools/extension_renamer.mjs
+++ b/tools/extension_renamer.mjs
@@ -1,5 +1,5 @@
 import * as assert from 'node:assert/strict';
-import { promises as fs } from 'node:fs';
+import * as fs from 'node:fs/promises';
 import * as path from 'node:path';
 import { fileURLToPath } from 'node:url';
 
diff --git a/tools/generate_import_path_list_markdown.mjs b/tools/generate_import_path_list_markdown.mjs
index cd35d9e0..cfa23c8d 100644
--- a/tools/generate_import_path_list_markdown.mjs
+++ b/tools/generate_import_path_list_markdown.mjs
@@ -1,5 +1,5 @@
 import * as assert from 'node:assert/strict';
-import { promises as fs } from 'node:fs';
+import * as fs from 'node:fs/promises';
 import * as path from 'node:path';
 import { fileURLToPath } from 'node:url';
 
diff --git a/tools/package_json_rewriter/json.mjs b/tools/package_json_rewriter/json.mjs
index 4f120712..dea49660 100644
--- a/tools/package_json_rewriter/json.mjs
+++ b/tools/package_json_rewriter/json.mjs
@@ -1,4 +1,4 @@
-import { promises as fs } from 'node:fs';
+import * as fs from 'node:fs/promises';
 import * as path from 'node:path';
 
 async function loadFileAsText(baseDir, filepath) {
diff --git a/tools/package_json_rewriter/main.mjs b/tools/package_json_rewriter/main.mjs
index 98980192..ca85493e 100644
--- a/tools/package_json_rewriter/main.mjs
+++ b/tools/package_json_rewriter/main.mjs
@@ -1,5 +1,5 @@
 import * as assert from 'node:assert/strict';
-import { promises as fs } from 'node:fs';
+import * as fs from 'node:fs/promises';
 import * as path from 'node:path';
 import { fileURLToPath } from 'node:url';
 


Test patch:
diff --git a/tools/test_esmodule_path_rewrite.mjs b/tools/test_esmodule_path_rewrite.mjs
index 7ee320a5..5f473bb7 100644
--- a/tools/test_esmodule_path_rewrite.mjs
+++ b/tools/test_esmodule_path_rewrite.mjs
@@ -1,5 +1,5 @@
 import * as assert from 'node:assert/strict';
-import { promises as fs } from 'node:fs';
+import * as fs from 'node:fs/promises';
 import * as path from 'node:path';
 import { fileURLToPath } from 'node:url';
 
diff --git a/tools/test_package_contains_expected_all.mjs b/tools/test_package_contains_expected_all.mjs
index 7da662aa..6cbfe253 100644
--- a/tools/test_package_contains_expected_all.mjs
+++ b/tools/test_package_contains_expected_all.mjs
@@ -1,5 +1,5 @@
 import * as assert from 'node:assert/strict';
-import { promises as fs } from 'node:fs';
+import * as fs from 'node:fs/promises';
 import * as path from 'node:path';
 import { fileURLToPath } from 'node:url';
Repository: karen-irc/option-t
Pull request #1520 (2023-01-19 17:50:38)

Use `node:test` for tools/test_package_exports.mjs


Patch:
diff --git a/Makefile b/Makefile
index d242e39d..35e9ecd2 100644
--- a/Makefile
+++ b/Makefile
@@ -219,7 +219,7 @@ __run_install_package: build
 
 .PHONY: run_test_package_install
 run_test_package_install:
-	$(NODE_BIN) $(CURDIR)/tools/test_package_exports.mjs
+	$(NODE_BIN) --test $(CURDIR)/tools/test_package_exports.mjs
 
 .PHONY: post_cleanup_to_test_package_install
 post_cleanup_to_test_package_install:


Test patch:
diff --git a/tools/test_package_exports.mjs b/tools/test_package_exports.mjs
index ebc10838..ee7fbe5c 100644
--- a/tools/test_package_exports.mjs
+++ b/tools/test_package_exports.mjs
@@ -1,5 +1,6 @@
 import * as assert from 'node:assert/strict';
 import { createRequire } from 'node:module';
+import test from 'node:test';
 
 import {
     generateAllExposedPathSequence,
@@ -77,18 +78,19 @@ async function tryImportPath(pathItem) {
 
     const list = generateAllExposedPathSequence();
 
-    const testingItems = [];
     for (const item of list) {
-        let testing = null;
+        const name = item.name();
+        const testLabel = `try to import \`${name}\``;
+
         if (item.isForCompat()) {
-            testing = tryImportPathForCompat(item);
+            test(testLabel, async (_t) => {
+                await tryImportPathForCompat(item);
+            });
         }
         else {
-            testing = tryImportPath(item);
+            test(testLabel, async (_t) => {
+                await tryImportPath(item);
+            });
         }
-
-        testingItems.push(testing);
     }
-
-    await Promise.all(testingItems);
 })();