summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-05-18 11:42:03 -0400
committerGitHub <noreply@github.com>2024-05-18 11:42:03 -0400
commita2dbcf9e0aa1f70056ccc6ecdd4c813d30af768c (patch)
treeae0c11a160b1203209b5a54d5dbb693d7dbc5135 /tests
parentfcb6a18b2b9fe23f3c19f6039d8f270a3a1999d6 (diff)
perf: analyze cjs exports and emit typescript in parallel (#23856)
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/inspector_tests.rs23
-rw-r--r--tests/specs/npm/local_dir_no_duplicate_resolution/__test__.jsonc2
-rw-r--r--tests/specs/npm/local_dir_no_duplicate_resolution/main.out8
-rw-r--r--tests/specs/npm/local_dir_no_duplicate_resolution/run_main_sorted_lines.ts19
4 files changed, 42 insertions, 10 deletions
diff --git a/tests/integration/inspector_tests.rs b/tests/integration/inspector_tests.rs
index 6a0f9111e..6f70d36ed 100644
--- a/tests/integration/inspector_tests.rs
+++ b/tests/integration/inspector_tests.rs
@@ -929,19 +929,32 @@ async fn inspector_with_ts_files() {
.await;
// receive messages with sources from this test
- let script1 = tester.recv().await;
- assert_contains!(script1, "testdata/inspector/test.ts");
+ let mut scripts = vec![
+ tester.recv().await,
+ tester.recv().await,
+ tester.recv().await,
+ ];
+ let script1 = scripts.remove(
+ scripts
+ .iter()
+ .position(|s| s.contains("testdata/inspector/test.ts"))
+ .unwrap(),
+ );
let script1_id = {
let v: serde_json::Value = serde_json::from_str(&script1).unwrap();
v["params"]["scriptId"].as_str().unwrap().to_string()
};
- let script2 = tester.recv().await;
- assert_contains!(script2, "testdata/inspector/foo.ts");
+ let script2 = scripts.remove(
+ scripts
+ .iter()
+ .position(|s| s.contains("testdata/inspector/foo.ts"))
+ .unwrap(),
+ );
let script2_id = {
let v: serde_json::Value = serde_json::from_str(&script2).unwrap();
v["params"]["scriptId"].as_str().unwrap().to_string()
};
- let script3 = tester.recv().await;
+ let script3 = scripts.remove(0);
assert_contains!(script3, "testdata/inspector/bar.js");
let script3_id = {
let v: serde_json::Value = serde_json::from_str(&script3).unwrap();
diff --git a/tests/specs/npm/local_dir_no_duplicate_resolution/__test__.jsonc b/tests/specs/npm/local_dir_no_duplicate_resolution/__test__.jsonc
index f7cc70f15..d7141c0bf 100644
--- a/tests/specs/npm/local_dir_no_duplicate_resolution/__test__.jsonc
+++ b/tests/specs/npm/local_dir_no_duplicate_resolution/__test__.jsonc
@@ -1,5 +1,5 @@
{
"tempDir": true,
- "args": "run -A --log-level=debug main.tsx",
+ "args": "run -A run_main_sorted_lines.ts",
"output": "main.out"
}
diff --git a/tests/specs/npm/local_dir_no_duplicate_resolution/main.out b/tests/specs/npm/local_dir_no_duplicate_resolution/main.out
index c2141bd7e..73aa13489 100644
--- a/tests/specs/npm/local_dir_no_duplicate_resolution/main.out
+++ b/tests/specs/npm/local_dir_no_duplicate_resolution/main.out
@@ -1,5 +1,5 @@
-[WILDCARD]Resolved preact from file:///[WILDLINE]/preact@10.19.6/node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
-DEBUG RS - [WILDLINE] - Resolved preact from file:///[WILDLINE]/preact@10.19.6/node_modules/preact/hooks/dist/hooks.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
[# ensure that preact is resolving to .deno/preact@10.19.6/node_modules/preact and not .deno/preact-render-to-string@6.4.0/node_modules/preact]
-DEBUG RS - [WILDLINE] - Resolved preact from file:///[WILDLINE]/preact-render-to-string@6.4.0/node_modules/preact-render-to-string/dist/index.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
-[WILDCARD]
+[WILDCARD]/preact-render-to-string@6.4.0/node_modules/preact-render-to-string/dist/index.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
+[WILDCARD]/preact@10.19.6/node_modules/preact/hooks/dist/hooks.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
+[WILDCARD]/preact@10.19.6/node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs to [WILDLINE]node_modules[WILDCHAR].deno[WILDCHAR]preact@10.19.6[WILDCHAR]node_modules[WILDCHAR]preact
+[WILDCARD] \ No newline at end of file
diff --git a/tests/specs/npm/local_dir_no_duplicate_resolution/run_main_sorted_lines.ts b/tests/specs/npm/local_dir_no_duplicate_resolution/run_main_sorted_lines.ts
new file mode 100644
index 000000000..54d460c29
--- /dev/null
+++ b/tests/specs/npm/local_dir_no_duplicate_resolution/run_main_sorted_lines.ts
@@ -0,0 +1,19 @@
+const { success, stderr } = new Deno.Command(
+ Deno.execPath(),
+ {
+ args: ["run", "-A", "--log-level=debug", "main.tsx"],
+ },
+).outputSync();
+const stderrText = new TextDecoder().decode(stderr);
+if (!success) {
+ console.error(stderrText);
+ throw new Error("Failed to run script.");
+}
+
+// create some stability with the output
+const lines = stderrText.split("\n")
+ .filter((line) => line.includes("Resolved preact from"));
+lines.sort();
+for (const line of lines) {
+ console.error(line);
+}