Skip to content

Commit 94a8856

Browse files
committed
Add unit test for packages with prerelease versions
1 parent 264be52 commit 94a8856

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/unit/loading/ModuleStateBuilder-test.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,37 @@ describe('ModuleStateBuilder', () => {
827827
});
828828
});
829829

830+
it('should resolve packages with the same lsd:module to the max prerelease version', async() => {
831+
expect(await builder.buildComponentModules({
832+
a: {
833+
version: '1.1.0-alpha.1',
834+
'lsd:module': 'ex:module',
835+
'lsd:components': 'components/components.jsonld',
836+
},
837+
b: {
838+
version: '1.0.0',
839+
'lsd:module': 'ex:module',
840+
'lsd:components': 'components/components.jsonld',
841+
},
842+
})).toEqual({
843+
'ex:module': 'a/components/components.jsonld',
844+
});
845+
expect(await builder.buildComponentModules({
846+
a: {
847+
version: '1.0.0-alpha.1',
848+
'lsd:module': 'ex:module',
849+
'lsd:components': 'components/components.jsonld',
850+
},
851+
b: {
852+
version: '1.0.0-alpha.2',
853+
'lsd:module': 'ex:module',
854+
'lsd:components': 'components/components.jsonld',
855+
},
856+
})).toEqual({
857+
'ex:module': 'b/components/components.jsonld',
858+
});
859+
});
860+
830861
it('should resolve packages with the same lsd:module and one invalid version to the valid version', async() => {
831862
expect(await builder.buildComponentModules({
832863
a: {

0 commit comments

Comments
 (0)