Skip to content

Commit 723299e

Browse files
committed
fix: broken test
1 parent cc0a5c1 commit 723299e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/api/__tests__/cache.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,15 @@ describe('#get', () => {
257257
});
258258

259259
it('should support the legacy `path` property in the cache store', async () => {
260+
const file = path.join(examplesDir, 'readme.yaml');
261+
cacheStore = new Cache(file);
260262
await cacheStore.saveFile();
261263

262264
const cache = cacheStore.getCache();
263-
cache['44ec0da6e10c8806831ba3d4126c1b66'].path = path.join(
264-
cacheStore.specsCache,
265-
`${cache['44ec0da6e10c8806831ba3d4126c1b66'].hash}.json`
266-
);
265+
const cacheKey = Object.keys(cache)[0];
266+
cache[cacheKey].path = path.join(cacheStore.specsCache, `${cache[cacheKey].hash}.json`);
267267

268-
delete cache['44ec0da6e10c8806831ba3d4126c1b66'].hash;
268+
delete cache[cacheKey].hash;
269269

270270
expect(Object.keys(cache)).toHaveLength(1);
271271

0 commit comments

Comments
 (0)