Skip to content

Commit ea281ac

Browse files
cursoragenthardfist
andcommitted
Test: Add assertions for block dependencies in chunk group
Co-authored-by: yangjianzju <yangjianzju@gmail.com>
1 parent a3f673a commit ea281ac

File tree

1 file changed

+10
-1
lines changed
  • tests/rspack-test/configCases/chunk-graph/get-chunk-group-blocks

1 file changed

+10
-1
lines changed

tests/rspack-test/configCases/chunk-graph/get-chunk-group-blocks/rspack.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,16 @@ class Plugin {
1212

1313
const blocks = compilation.chunkGraph.getChunkGroupBlocks(chunkGroup);
1414
expect(blocks.length).toBe(1);
15-
expect(blocks[0]).toBe(block);
15+
const blockFromGroup = blocks[0];
16+
expect(blockFromGroup).toBe(block);
17+
18+
const blockDependencies = block.dependencies;
19+
expect(blockDependencies.length).toBe(1);
20+
expect(blockDependencies[0].request).toBe("./foo");
21+
22+
const groupBlockDependencies = blockFromGroup.dependencies;
23+
expect(groupBlockDependencies.length).toBe(1);
24+
expect(groupBlockDependencies[0]).toBe(blockDependencies[0]);
1625
});
1726
});
1827
}

0 commit comments

Comments
 (0)