summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-03-15 10:27:43 -0400
committerGitHub <noreply@github.com>2024-03-15 14:27:43 +0000
commitce768bac834c1efebf2663b01f6e46db99329631 (patch)
tree80499c54ba7973e8433ceff3436757ec46717f2d /tests/specs
parent36e6e4a00997603d2290c416239c2de8feeb6ede (diff)
chore(lsp): add tests for compiler options being resolved relative the config file (#22924)
Investigation from #17298
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/README.md1
-rw-r--r--tests/specs/check/types_resolved_relative_config/__test__.json5
-rw-r--r--tests/specs/check/types_resolved_relative_config/main.out3
-rw-r--r--tests/specs/check/types_resolved_relative_config/main.ts0
-rw-r--r--tests/specs/check/types_resolved_relative_config/sub_dir/deno.json7
-rw-r--r--tests/specs/mod.rs4
6 files changed, 20 insertions, 0 deletions
diff --git a/tests/specs/README.md b/tests/specs/README.md
index bbd9b880c..d04adbb62 100644
--- a/tests/specs/README.md
+++ b/tests/specs/README.md
@@ -90,3 +90,4 @@ Within the file, you can use the following for matching:
- `[WILDCHARS(5)]` - match any of the next 5 characters
- `[UNORDERED_START]` followed by many lines then `[UNORDERED_END]` will match
the lines in any order (useful for non-deterministic output)
+- `[# example]` - line comments start with `[#` and end with `]`
diff --git a/tests/specs/check/types_resolved_relative_config/__test__.json b/tests/specs/check/types_resolved_relative_config/__test__.json
new file mode 100644
index 000000000..6f4937209
--- /dev/null
+++ b/tests/specs/check/types_resolved_relative_config/__test__.json
@@ -0,0 +1,5 @@
+{
+ "args": "check --config sub_dir/deno.json main.ts",
+ "output": "main.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/check/types_resolved_relative_config/main.out b/tests/specs/check/types_resolved_relative_config/main.out
new file mode 100644
index 000000000..212e1224c
--- /dev/null
+++ b/tests/specs/check/types_resolved_relative_config/main.out
@@ -0,0 +1,3 @@
+[# It should be resolving relative the config in sub_dir instead of the cwd]
+error: Module not found "file:///[WILDLINE]/sub_dir/a.d.ts".
+ at file:///[WILDLINE]/sub_dir/deno.json:1:1
diff --git a/tests/specs/check/types_resolved_relative_config/main.ts b/tests/specs/check/types_resolved_relative_config/main.ts
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/specs/check/types_resolved_relative_config/main.ts
diff --git a/tests/specs/check/types_resolved_relative_config/sub_dir/deno.json b/tests/specs/check/types_resolved_relative_config/sub_dir/deno.json
new file mode 100644
index 000000000..ba7f3344d
--- /dev/null
+++ b/tests/specs/check/types_resolved_relative_config/sub_dir/deno.json
@@ -0,0 +1,7 @@
+{
+ "compilerOptions": {
+ "types": [
+ "./a.d.ts"
+ ]
+ }
+}
diff --git a/tests/specs/mod.rs b/tests/specs/mod.rs
index 6a61ae2a6..7795f47de 100644
--- a/tests/specs/mod.rs
+++ b/tests/specs/mod.rs
@@ -24,6 +24,10 @@ pub fn main() {
// todo(dsherret): the output should be changed to be terse
// when it passes, but verbose on failure
for category in &categories {
+ if category.tests.is_empty() {
+ continue; // skip output when all the tests have been filtered out
+ }
+
eprintln!();
eprintln!(" {} {}", colors::green_bold("Running"), category.name);
eprintln!();