Skip to content

Commit 9b01501

Browse files
committed
fix unit test
1 parent 2d152ae commit 9b01501

File tree

1 file changed

+9
-6
lines changed
  • turbopack/crates/turbopack-core/src/module_graph

1 file changed

+9
-6
lines changed

turbopack/crates/turbopack-core/src/module_graph/mod.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ pub mod tests {
16381638
ident::AssetIdent,
16391639
module::Module,
16401640
module_graph::{
1641-
GraphEntries, GraphTraversalAction, ModuleGraphRef, SingleModuleGraph,
1641+
GraphEntries, GraphTraversalAction, ModuleGraph, ModuleGraphRef, SingleModuleGraph,
16421642
chunk_group_info::ChunkGroupEntry,
16431643
},
16441644
reference::{ModuleReference, ModuleReferences, SingleChunkableModuleReference},
@@ -1931,22 +1931,25 @@ pub mod tests {
19311931
entry_modules.clone(),
19321932
)])),
19331933
false,
1934-
)
1935-
.await?;
1934+
);
19361935

19371936
// Create a simple name mapping to make analyzing the visitors easier.
19381937
// Technically they could always pull this name off of the
1939-
// `module.ident().await?.path.path` themselves but that `await` is trick in the
1940-
// visitors so precomputing this helps.
1938+
// `module.ident().await?.path.path` themselves but you cannot `await` in visitors.
19411939
let module_to_name = graph
1940+
.await?
19421941
.modules
19431942
.keys()
19441943
.map(|m| async move { Ok((*m, m.ident().await?.path.path.clone())) })
19451944
.try_join()
19461945
.await?
19471946
.into_iter()
19481947
.collect();
1949-
test_fn(graph.read(), entry_modules, module_to_name)
1948+
test_fn(
1949+
ModuleGraph::from_single_graph(graph).read_graphs().await?,
1950+
entry_modules,
1951+
module_to_name,
1952+
)
19501953
})
19511954
.await
19521955
.unwrap();

0 commit comments

Comments
 (0)