@@ -119,6 +119,61 @@ describe('PackageMetadataLoader', () => {
119119 } ) ;
120120 } ) ;
121121
122+ it ( 'should return with all required entries with lsd:module true' , async ( ) => {
123+ resolutionContext . contentsOverrides = {
124+ [ Path . normalize ( '/package.json' ) ] : `{
125+ "name": "@solid/community-server",
126+ "version": "1.2.3",
127+ "lsd:module": true,
128+ "types": "./index.d.ts"
129+ }` ,
130+ } ;
131+ expect ( await loader . load ( '/' ) ) . toEqual ( {
132+ componentsPath : Path . normalize ( '/components/components.jsonld' ) ,
133+ contexts : {
134+ 'https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld' :
135+ 'components/context.jsonld' ,
136+ } ,
137+ importPaths : {
138+ 'https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/' :
139+ 'components/' ,
140+ 'https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/config/' : 'config/' ,
141+ } ,
142+ moduleIri : 'https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server' ,
143+ name : '@solid/community-server' ,
144+ version : '1.2.3' ,
145+ typesPath : Path . normalize ( '/index' ) ,
146+ } ) ;
147+ } ) ;
148+
149+ it ( 'should return with all required entries with lsd:module true and lsd:basePath' , async ( ) => {
150+ resolutionContext . contentsOverrides = {
151+ [ Path . normalize ( '/package.json' ) ] : `{
152+ "name": "@solid/community-server",
153+ "version": "1.2.3",
154+ "lsd:module": true,
155+ "lsd:basePath": "dist/",
156+ "types": "./index.d.ts"
157+ }` ,
158+ } ;
159+ expect ( await loader . load ( '/' ) ) . toEqual ( {
160+ componentsPath : Path . normalize ( '/dist/components/components.jsonld' ) ,
161+ contexts : {
162+ 'https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld' :
163+ 'dist/components/context.jsonld' ,
164+ } ,
165+ importPaths : {
166+ 'https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/' :
167+ 'dist/components/' ,
168+ 'https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/config/' : 'dist/config/' ,
169+ } ,
170+ moduleIri : 'https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server' ,
171+ name : '@solid/community-server' ,
172+ version : '1.2.3' ,
173+ typesPath : Path . normalize ( '/index' ) ,
174+ } ) ;
175+ } ) ;
176+
122177 it ( 'should error on invalid JSON' , async ( ) => {
123178 resolutionContext . contentsOverrides = {
124179 [ Path . normalize ( '/package.json' ) ] : `{` ,
0 commit comments