Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ json-strip-comments = "1.0.2"
indexmap = { version = "2.2.6", features = ["serde"] }
cfg-if = "1.0"

pnp = { version = "0.9.1", optional = true }
pnp = { version = "0.9.2", optional = true }

document-features = { version = "0.2.8", optional = true }
futures = "0.3.31"
Expand Down
27 changes: 27 additions & 0 deletions src/tests/pnp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,33 @@ async fn pnp1() {
)),
);
}

#[tokio::test]
async fn pnp_resolve_description_file() {
let fixture = super::fixture_root().join("pnp");

let resolver = Resolver::new(ResolveOptions {
extensions: vec![".js".into()],
condition_names: vec!["import".into()],
..ResolveOptions::default()
});

let full_path = fixture.join(
".yarn/cache/preact-npm-10.25.4-2dd2c0aa44-33a009d614.zip/node_modules/preact/dist/preact.js",
).to_string_lossy().to_string();

let r = resolver.resolve(&fixture, &full_path).await.unwrap();

assert_eq!(
r.package_json.unwrap().path.to_string_lossy().to_string(),
fixture
.join(".yarn/cache/preact-npm-10.25.4-2dd2c0aa44-33a009d614.zip/node_modules/preact")
.join("package.json")
.to_string_lossy()
.to_string()
);
}

#[tokio::test]
async fn resolve_in_pnp_linked_folder() {
let fixture = super::fixture_root().join("pnp");
Expand Down
Loading