Skip to content

Commit 57f3b61

Browse files
authored
Merge pull request #7 from ThirdKeyAI/chore/drop-node18
ci: drop Node 18 from matrix; tighten engines to >=20
2 parents 36b4c61 + 2026990 commit 57f3b61

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
node-version: ["18.x", "20.x", "22.x"]
20+
# Vitest 3.x + Vite 5 (pure-ESM) require Node 20+; Node 18 breaks
21+
# on `require()` of vite from vitest's CJS loader.
22+
node-version: ["20.x", "22.x"]
2123

2224
steps:
2325
- uses: actions/checkout@v4

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"zod": "^3.22.0"
4848
},
4949
"engines": {
50-
"node": ">=16.0.0"
50+
"node": ">=20.0.0"
5151
},
5252
"repository": {
5353
"type": "git",

packages/core/src/memory/__tests__/InMemoryStore.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,17 @@ describe('InMemoryStore', () => {
6060

6161
await store.store(memory);
6262
const retrieved = await store.get('test-1');
63-
64-
expect(retrieved).toEqual({
63+
64+
// `get()` calls `recordAccess()`, which bumps accessCount AND refreshes
65+
// the timestamp — assert the stable fields and verify timestamp is
66+
// at or after the stored time, rather than deep-equal on the whole
67+
// object (which used to flake when retrieval landed in the same ms).
68+
expect(retrieved).toMatchObject({
6569
...memory,
66-
accessCount: 1, // Access count should be incremented on retrieval
70+
accessCount: 1,
71+
timestamp: expect.any(Date),
6772
});
73+
expect(retrieved!.timestamp.getTime()).toBeGreaterThanOrEqual(memory.timestamp.getTime());
6874
});
6975

7076
it('should create copy of stored memory', async () => {

0 commit comments

Comments
 (0)