mirror of
https://github.com/kevinthedang/discord-ollama.git
synced 2025-12-12 19:56:06 -05:00
Initialize unit testing and code coverage
* add: vitest configs * added vitest scripts to package * test coverage of src code * initial unit testing * added new testing workflows * comments added, overlapping tests removed * decouple env, tests --------- Co-authored-by: Kevin Dang <kevinthedang_1@outlook.com>
This commit is contained in:
23
tests/events.test.ts
Normal file
23
tests/events.test.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import events from '../src/events'
|
||||
|
||||
/**
|
||||
* Events test suite, tests the events object
|
||||
* Each event is to be tested elsewhere, this file
|
||||
* is to ensure that the events object is defined.
|
||||
*
|
||||
* @param name name of the test suite
|
||||
* @param fn function holding tests to run
|
||||
*/
|
||||
describe('#events', () => {
|
||||
// test definition of events object
|
||||
it('references defined object', () => {
|
||||
expect(typeof events).toBe('object')
|
||||
})
|
||||
|
||||
// test specific events in the object
|
||||
it('references specific events', () => {
|
||||
const eventsString = events.map(e => e.key.toString()).join(', ')
|
||||
expect(eventsString).toBe('ready, messageCreate, interactionCreate')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user