@@ -207,6 +207,56 @@ describe.each(['pnpm-lock-v5', 'pnpm-lock-v6', 'pnpm-lock-v9'])(
207207 ) ,
208208 ) ;
209209 } ) ;
210+
211+ it ( 'project: simple-non-top-level-out-of-sync does not throws OutOfSyncError for strictOutOfSync=false' , async ( ) => {
212+ const fixtureName = 'missing-non-top-level-deps' ;
213+ const pkgJsonContent = readFileSync (
214+ join (
215+ __dirname ,
216+ `./fixtures/${ lockFileVersionPath } /${ fixtureName } /package.json` ,
217+ ) ,
218+ 'utf8' ,
219+ ) ;
220+ const pnpmLockContent = readFileSync (
221+ join (
222+ __dirname ,
223+ `./fixtures/${ lockFileVersionPath } /${ fixtureName } /pnpm-lock.yaml` ,
224+ ) ,
225+ 'utf8' ,
226+ ) ;
227+ const deGraph = parsePnpmProject ( pkgJsonContent , pnpmLockContent , {
228+ includeDevDeps : false ,
229+ includeOptionalDeps : true ,
230+ pruneWithinTopLevelDeps : true ,
231+ strictOutOfSync : false ,
232+ } ) ;
233+ expect ( deGraph ) . toBeDefined ( ) ;
234+ } ) ;
235+
236+ it ( 'project: simple-top-level-out-of-sync does not throws OutOfSyncError for strictOutOfSync=false' , async ( ) => {
237+ const fixtureName = 'missing-top-level-deps' ;
238+ const pkgJsonContent = readFileSync (
239+ join (
240+ __dirname ,
241+ `./fixtures/${ lockFileVersionPath } /${ fixtureName } /package.json` ,
242+ ) ,
243+ 'utf8' ,
244+ ) ;
245+ const pnpmLockContent = readFileSync (
246+ join (
247+ __dirname ,
248+ `./fixtures/${ lockFileVersionPath } /${ fixtureName } /pnpm-lock.yaml` ,
249+ ) ,
250+ 'utf8' ,
251+ ) ;
252+ const deGraph = parsePnpmProject ( pkgJsonContent , pnpmLockContent , {
253+ includeDevDeps : false ,
254+ includeOptionalDeps : true ,
255+ pruneWithinTopLevelDeps : true ,
256+ strictOutOfSync : false ,
257+ } ) ;
258+ expect ( deGraph ) . toBeDefined ( ) ;
259+ } ) ;
210260 } ) ;
211261 } ,
212262) ;
0 commit comments