@@ -205,11 +205,10 @@ describe("checkDepsStatus", () => {
205205 } ) ;
206206
207207 await fs . writeFile ( path . join ( base , "pnpm-lock.yaml" ) , "lock" , "utf8" ) ;
208- await expect ( checkDepsStatus ( { root : base , manager : "pnpm" } ) ) . resolves . toMatchObject ( {
209- manager : "pnpm" ,
210- status : "missing" ,
211- reason : "node_modules marker missing" ,
212- } ) ;
208+ const missingDeps = await checkDepsStatus ( { root : base , manager : "pnpm" } ) ;
209+ expect ( missingDeps . manager ) . toBe ( "pnpm" ) ;
210+ expect ( missingDeps . status ) . toBe ( "missing" ) ;
211+ expect ( missingDeps . reason ) . toBe ( "node_modules marker missing" ) ;
213212
214213 const markerPath = path . join ( base , "node_modules" , ".modules.yaml" ) ;
215214 await fs . mkdir ( path . dirname ( markerPath ) , { recursive : true } ) ;
@@ -219,18 +218,16 @@ describe("checkDepsStatus", () => {
219218 await fs . utimes ( markerPath , staleDate , staleDate ) ;
220219 await fs . utimes ( path . join ( base , "pnpm-lock.yaml" ) , freshDate , freshDate ) ;
221220
222- await expect ( checkDepsStatus ( { root : base , manager : "pnpm" } ) ) . resolves . toMatchObject ( {
223- manager : "pnpm" ,
224- status : "stale" ,
225- reason : "lockfile newer than install marker" ,
226- } ) ;
221+ const staleDeps = await checkDepsStatus ( { root : base , manager : "pnpm" } ) ;
222+ expect ( staleDeps . manager ) . toBe ( "pnpm" ) ;
223+ expect ( staleDeps . status ) . toBe ( "stale" ) ;
224+ expect ( staleDeps . reason ) . toBe ( "lockfile newer than install marker" ) ;
227225
228226 const newerMarker = new Date ( Date . now ( ) + 2_000 ) ;
229227 await fs . utimes ( markerPath , newerMarker , newerMarker ) ;
230- await expect ( checkDepsStatus ( { root : base , manager : "pnpm" } ) ) . resolves . toMatchObject ( {
231- manager : "pnpm" ,
232- status : "ok" ,
233- } ) ;
228+ const okDeps = await checkDepsStatus ( { root : base , manager : "pnpm" } ) ;
229+ expect ( okDeps . manager ) . toBe ( "pnpm" ) ;
230+ expect ( okDeps . status ) . toBe ( "ok" ) ;
234231 } ) ;
235232 } ) ;
236233} ) ;
@@ -257,18 +254,18 @@ describe("checkUpdateStatus", () => {
257254 await fs . writeFile ( path . join ( root , "package-lock.json" ) , "lock" , "utf8" ) ;
258255 await fs . mkdir ( path . join ( root , "node_modules" ) , { recursive : true } ) ;
259256
260- await expect (
261- checkUpdateStatus ( { root, includeRegistry : false , fetchGit : false , timeoutMs : 1000 } ) ,
262- ) . resolves . toMatchObject ( {
257+ const status = await checkUpdateStatus ( {
263258 root,
264- installKind : "package" ,
265- packageManager : "npm" ,
266- git : undefined ,
267- registry : undefined ,
268- deps : {
269- manager : "npm" ,
270- } ,
259+ includeRegistry : false ,
260+ fetchGit : false ,
261+ timeoutMs : 1000 ,
271262 } ) ;
263+ expect ( status . root ) . toBe ( root ) ;
264+ expect ( status . installKind ) . toBe ( "package" ) ;
265+ expect ( status . packageManager ) . toBe ( "npm" ) ;
266+ expect ( status . git ) . toBeUndefined ( ) ;
267+ expect ( status . registry ) . toBeUndefined ( ) ;
268+ expect ( status . deps ?. manager ) . toBe ( "npm" ) ;
272269 } ) ;
273270 } ) ;
274271
@@ -285,20 +282,15 @@ describe("checkUpdateStatus", () => {
285282 await runCommandWithTimeout ( [ "git" , "init" ] , { cwd : repoRoot , timeoutMs : 1000 } ) ;
286283 await fs . symlink ( repoRoot , linkedRoot ) ;
287284
288- await expect (
289- checkUpdateStatus ( {
290- root : linkedRoot ,
291- includeRegistry : false ,
292- fetchGit : false ,
293- timeoutMs : 1000 ,
294- } ) ,
295- ) . resolves . toMatchObject ( {
285+ const status = await checkUpdateStatus ( {
296286 root : linkedRoot ,
297- installKind : "git" ,
298- git : {
299- root : linkedRoot ,
300- } ,
287+ includeRegistry : false ,
288+ fetchGit : false ,
289+ timeoutMs : 1000 ,
301290 } ) ;
291+ expect ( status . root ) . toBe ( linkedRoot ) ;
292+ expect ( status . installKind ) . toBe ( "git" ) ;
293+ expect ( status . git ?. root ) . toBe ( linkedRoot ) ;
302294 } ) ;
303295 } ) ;
304296} ) ;
0 commit comments