Skip to content

Commit 454d834

Browse files
committed
test(dlx): update cache key generation in test to match implementation
1 parent 5c6419d commit 454d834

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/dlx-binary.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,11 @@ describe.sequential('dlx-binary', () => {
367367
await result1.spawnPromise.catch(() => {})
368368

369369
// Corrupt metadata
370-
const name = 'invalid-meta-binary'
371-
const cacheKey = createHash('sha256')
372-
.update(`${url}:${name}`)
370+
const spec = url
371+
const cacheKey = createHash('sha512')
372+
.update(spec)
373373
.digest('hex')
374+
.substring(0, 16)
374375
const cachePath = getDlxCachePath()
375376
const metaPath = path.join(cachePath, cacheKey, '.dlx-metadata.json')
376377
await fs.writeFile(metaPath, 'invalid json', 'utf8')

0 commit comments

Comments
 (0)