Skip to content

Commit

Permalink
chore: update ci snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
owlstronaut committed Feb 11, 2025
1 parent c18583b commit d393409
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
30 changes: 15 additions & 15 deletions tap-snapshots/test/lib/commands/cache.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,42 +43,42 @@ make-fetch-happen:request-cache:https://registry.npmjs.org/foo/-/foo-1.2.3-beta.

exports[`test/lib/commands/cache.js TAP cache npx info: valid and invalid entry > shows invalid package info 1`] = `
invalid npx cache entry with key deadbeef
location: /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-info-valid-and-invalid-entry/cache/_npx/deadbeef
location: {CWD}/cache/_npx/deadbeef
invalid npx cache entry with key badc0de
location: /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-info-valid-and-invalid-entry/cache/_npx/badc0de
location: {CWD}/cache/_npx/badc0de
`

exports[`test/lib/commands/cache.js TAP cache npx info: valid and invalid entry > shows valid package info 1`] = `
invalid npx cache entry with key deadbeef
location: /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-info-valid-and-invalid-entry/cache/_npx/deadbeef
location: {CWD}/cache/_npx/deadbeef
`

exports[`test/lib/commands/cache.js TAP cache npx info: valid entry with _npx directory package > shows valid package info with _npx directory package 1`] = `
valid npx cache entry with key valid123
location: /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-info-valid-entry-with-_npx-directory-package/cache/_npx/valid123
location: {CWD}/cache/_npx/valid123
packages:
- /path/to/valid-package
`

exports[`test/lib/commands/cache.js TAP cache npx info: valid entry with _npx packages > shows valid package info with _npx packages 1`] = `
valid npx cache entry with key valid123
location: /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-info-valid-entry-with-_npx-packages/cache/_npx/valid123
location: {CWD}/cache/_npx/valid123
packages:
- [email protected] ([email protected])
`

exports[`test/lib/commands/cache.js TAP cache npx info: valid entry with a link dependency > shows link dependency realpath (child.isLink branch) 1`] = `
valid npx cache entry with key link123
location: /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-info-valid-entry-with-a-link-dependency/cache/_npx/link123
location: {CWD}/cache/_npx/link123
packages: (unknown)
dependencies:
- /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-info-valid-entry-with-a-link-dependency/cache/_npx/some-other-loc
- {CWD}/cache/_npx/some-other-loc
`

exports[`test/lib/commands/cache.js TAP cache npx info: valid entry with dependencies > shows valid package info with dependencies 1`] = `
valid npx cache entry with key valid456
location: /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-info-valid-entry-with-dependencies/cache/_npx/valid456
location: {CWD}/cache/_npx/valid456
packages: (unknown)
dependencies:
- [email protected]
Expand All @@ -98,23 +98,23 @@ z9y8x7: (empty/invalid)
`

exports[`test/lib/commands/cache.js TAP cache npx rm: remove single entry > logs removing single npx cache entry 1`] = `
Removing npx key at /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-rm-remove-single-entry/cache/_npx/123removeme
Removing npx key at /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-rm-remove-single-entry/cache/_npx/123removeme
Removing npx key at {CWD}/cache/_npx/123removeme
Removing npx key at {CWD}/cache/_npx/123removeme
`

exports[`test/lib/commands/cache.js TAP cache npx rm: removing all with --force works > logs removing everything 1`] = `
Removing npx key at /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-rm-removing-all-with---force-works/cache/_npx/remove-all-yes-force
Removing npx key at {CWD}/cache/_npx/remove-all-yes-force
`

exports[`test/lib/commands/cache.js TAP cache npx rm: removing all without --force fails > logs usage error when removing all without --force 1`] = `
`

exports[`test/lib/commands/cache.js TAP cache npx rm: removing more than 1, less than all entries > logs removing 2 of 3 entries 1`] = `
Removing npx key at /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-rm-removing-more-than-1-less-than-all-entries/cache/_npx/123removeme
Removing npx key at /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-rm-removing-more-than-1-less-than-all-entries/cache/_npx/456removeme
Removing npx key at /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-rm-removing-more-than-1-less-than-all-entries/cache/_npx/123removeme
Removing npx key at /Users/owlstronaut/Documents/npmjs/cli/test/lib/commands/tap-testdir-cache-cache-npx-rm-removing-more-than-1-less-than-all-entries/cache/_npx/456removeme
Removing npx key at {CWD}/cache/_npx/123removeme
Removing npx key at {CWD}/cache/_npx/456removeme
Removing npx key at {CWD}/cache/_npx/123removeme
Removing npx key at {CWD}/cache/_npx/456removeme
`

exports[`test/lib/commands/cache.js TAP cache rm > logs deleting single entry 1`] = `
Expand Down
3 changes: 2 additions & 1 deletion test/lib/commands/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const MockRegistry = require('@npmcli/mock-registry')
const cacache = require('cacache')
const fs = require('node:fs')
const path = require('node:path')
const { cleanCwd } = require('../../fixtures/clean-snapshot.js')

const pkg = 'test-package'

Expand All @@ -23,7 +24,7 @@ const createNpxCacheEntry = (npxCacheDir, hash, pkgJson, shrinkwrapJson) => {
}

t.cleanSnapshot = str => {
return str
return cleanCwd(str)
.replace(/Finished in [0-9.s]+/g, 'Finished in xxxs')
.replace(/Cache verified and compressed (.*)/, 'Cache verified and compressed ({PATH})')
}
Expand Down

0 comments on commit d393409

Please sign in to comment.