Skip to content

Commit e6adb88

Browse files
authored
chore: add test case for tsconfig paths alias fall through (#147)
1 parent 7866055 commit e6adb88

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/tests/tsconfig_paths.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
55
use std::path::{Path, PathBuf};
66

7-
use crate::{ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences};
7+
use crate::{
8+
ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences,
9+
};
810

911
// <https://github.com/parcel-bundler/parcel/blob/b6224fd519f95e68d8b93ba90376fd94c8b76e69/packages/utils/node-resolver-rs/src/lib.rs#L2303>
1012
#[test]
@@ -56,6 +58,22 @@ fn tsconfig() {
5658
}
5759
}
5860

61+
#[test]
62+
fn tsconfig_fallthrough() {
63+
let f = super::fixture_root().join("tsconfig");
64+
65+
let resolver = Resolver::new(ResolveOptions {
66+
tsconfig: Some(TsconfigOptions {
67+
config_file: f.join("tsconfig.json"),
68+
references: TsconfigReferences::Auto,
69+
}),
70+
..ResolveOptions::default()
71+
});
72+
73+
let resolved_path = resolver.resolve(&f, "/");
74+
assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into())));
75+
}
76+
5977
#[test]
6078
fn json_with_comments() {
6179
let f = super::fixture_root().join("tsconfig/cases/trailing-comma");

0 commit comments

Comments
 (0)