updated src/events/messageCreate.ts, src/index.ts; npx tsc no errors

This commit is contained in:
2025-05-18 11:30:01 -04:00
parent c8d35b9e75
commit 5683375649
3 changed files with 83 additions and 19 deletions

View File

@@ -1,6 +1,14 @@
import { describe, expect, it, vi } from 'vitest'
import events from '../src/events/index.js'
import { redis } from '../client.js';
jest.mock('../client.js', () => ({
redis: {
get: jest.fn().mockResolvedValue('0.5'),
set: jest.fn().mockResolvedValue('OK'),
},
}));
/**
* Mocking ollama found in client.ts because pullModel.ts
* relies on the existence on ollama. To prevent the mock,
@@ -28,4 +36,4 @@ describe('Events Existence', () => {
const eventsString = events.map(e => e.key.toString()).join(', ')
expect(eventsString).toBe('ready, messageCreate, interactionCreate, threadDelete')
})
})
})