diff --git a/bin/.node-20.9.0.pkg b/bin/.node-20.15.1.pkg similarity index 100% rename from bin/.node-20.9.0.pkg rename to bin/.node-20.15.1.pkg diff --git a/bin/.pnpm-8.15.4.pkg b/bin/.pnpm-9.6.0.pkg similarity index 100% rename from bin/.pnpm-8.15.4.pkg rename to bin/.pnpm-9.6.0.pkg diff --git a/bin/corepack b/bin/corepack index a18aecd8e..8ff3b5ad5 120000 --- a/bin/corepack +++ b/bin/corepack @@ -1 +1 @@ -.node-20.9.0.pkg \ No newline at end of file +.node-20.15.1.pkg \ No newline at end of file diff --git a/bin/node b/bin/node index a18aecd8e..8ff3b5ad5 120000 --- a/bin/node +++ b/bin/node @@ -1 +1 @@ -.node-20.9.0.pkg \ No newline at end of file +.node-20.15.1.pkg \ No newline at end of file diff --git a/bin/npm b/bin/npm index a18aecd8e..8ff3b5ad5 120000 --- a/bin/npm +++ b/bin/npm @@ -1 +1 @@ -.node-20.9.0.pkg \ No newline at end of file +.node-20.15.1.pkg \ No newline at end of file diff --git a/bin/npx b/bin/npx index a18aecd8e..8ff3b5ad5 120000 --- a/bin/npx +++ b/bin/npx @@ -1 +1 @@ -.node-20.9.0.pkg \ No newline at end of file +.node-20.15.1.pkg \ No newline at end of file diff --git a/bin/pnpm b/bin/pnpm index ccd74cafc..aa8e07c5b 120000 --- a/bin/pnpm +++ b/bin/pnpm @@ -1 +1 @@ -.pnpm-8.15.4.pkg \ No newline at end of file +.pnpm-9.6.0.pkg \ No newline at end of file diff --git a/packages/agent/package.json b/packages/agent/package.json index d1fa49b8d..32abef05a 100644 --- a/packages/agent/package.json +++ b/packages/agent/package.json @@ -91,7 +91,7 @@ "@types/mocha": "10.0.1", "@types/ms": "0.7.31", "@types/node": "20.11.19", - "@types/sinon": "17.0.2", + "@types/sinon": "17.0.3", "@typescript-eslint/eslint-plugin": "7.9.0", "@typescript-eslint/parser": "7.14.1", "@web/test-runner": "0.18.2", @@ -107,7 +107,7 @@ "node-stdlib-browser": "1.2.0", "playwright": "1.45.3", "rimraf": "4.4.0", - "sinon": "16.1.3", + "sinon": "18.0.0", "typescript": "5.1.6" } } diff --git a/packages/agent/tests/prototyping/clients/dwn-server-info-cache.spec.ts b/packages/agent/tests/prototyping/clients/dwn-server-info-cache.spec.ts index d8c2b1733..dfe8609dd 100644 --- a/packages/agent/tests/prototyping/clients/dwn-server-info-cache.spec.ts +++ b/packages/agent/tests/prototyping/clients/dwn-server-info-cache.spec.ts @@ -4,13 +4,11 @@ import { expect } from 'chai'; import { DwnServerInfoCache, ServerInfo } from '../../../src/prototyping/clients/server-info-types.js'; import { DwnServerInfoCacheMemory } from '../../../src/prototyping/clients/dwn-server-info-cache-memory.js'; -import { isNode } from '../../utils/runtimes.js'; describe('DwnServerInfoCache', () => { describe(`DwnServerInfoCacheMemory`, () => { let cache: DwnServerInfoCache; - let clock: sinon.SinonFakeTimers; const exampleInfo:ServerInfo = { maxFileSize : 100, @@ -23,14 +21,12 @@ describe('DwnServerInfoCache', () => { }); beforeEach(() => { - clock = sinon.useFakeTimers(); cache = new DwnServerInfoCacheMemory(); }); afterEach(async () => { await cache.clear(); await cache.close(); - clock.restore(); }); it('sets server info in cache', async () => { @@ -96,11 +92,9 @@ describe('DwnServerInfoCache', () => { }); it('returns undefined after ttl', async function () { - // skip this test in the browser, sinon fake timers don't seem to work here - // with a an await setTimeout in the test, it passes. - if (!isNode) { - this.skip(); - } + // NOTE: tried very hard to use sinon.useFakeTimers() but couldn't get it to work with `TtlCache` implementation in `DwnServerInfoCacheMemory`. + // I sanity added a setInterval here, and it obeys the fake time ticks and its callback is fired, but the `TtlCache` just ignores the fake timer ticks. + cache = new DwnServerInfoCacheMemory({ ttl: '100ms'}); const key = 'some-key1'; await cache.set(key, { ...exampleInfo }); @@ -109,8 +103,8 @@ describe('DwnServerInfoCache', () => { expect(result!.webSocketSupport).to.deep.equal(true); expect(result).to.deep.equal(exampleInfo); - // wait until 15m default ttl is up - await clock.tickAsync('15:01'); + // sleep for 100ms + await new Promise((resolve) => setTimeout(resolve, 100)); const resultAfter = await cache.get(key); expect(resultAfter).to.be.undefined; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cbccbcb16..bd19252e7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,8 +101,8 @@ importers: specifier: 20.11.19 version: 20.11.19 '@types/sinon': - specifier: 17.0.2 - version: 17.0.2 + specifier: 17.0.3 + version: 17.0.3 '@typescript-eslint/eslint-plugin': specifier: 7.9.0 version: 7.9.0(@typescript-eslint/parser@7.14.1(eslint@9.3.0)(typescript@5.1.6))(eslint@9.3.0)(typescript@5.1.6) @@ -146,8 +146,8 @@ importers: specifier: 4.4.0 version: 4.4.0 sinon: - specifier: 16.1.3 - version: 16.1.3 + specifier: 18.0.0 + version: 18.0.0 typescript: specifier: 5.1.6 version: 5.1.6