* Add: skeleton suite for command tests (#119) * test naming updated * fix imports, remove old references * added code coverage badge * Add: coverage environment * Fix: Readme hyperlink to coverage workflow * grab coverage pct from env * Update: gist hyperlink * color range on coverage * fix contributing, simplify coverage assessment * lmiit coverage to master, add branch naming conventions --------- Co-authored-by: Kevin Dang <77701718+kevinthedang@users.noreply.github.com>
72 lines
1.8 KiB
TypeScript
72 lines
1.8 KiB
TypeScript
// describe marks a test suite
|
|
// expect takes a value from an expression
|
|
// it marks a test case
|
|
import { describe, expect, it } from 'vitest'
|
|
import commands from '../src/commands/index.js'
|
|
|
|
/**
|
|
* Commands test suite, tests the commands object
|
|
* Each command is to be tested elsewhere, this file
|
|
* is to ensure that the commands object is defined.
|
|
*
|
|
* @param name name of the test suite
|
|
* @param fn function holding tests to run
|
|
*/
|
|
describe('Commands Existence', () => {
|
|
// test definition of commands object
|
|
it('references defined object', () => {
|
|
// toBe compares the value to the expected value
|
|
expect(typeof commands).toBe('object')
|
|
})
|
|
|
|
// test specific commands in the object
|
|
it('references specific commands', () => {
|
|
const commandsString = commands.map(e => e.name).join(', ')
|
|
expect(commandsString).toBe('thread, private-thread, message-style, message-stream, toggle-chat, shutoff, modify-capacity, clear-user-channel-history')
|
|
})
|
|
})
|
|
|
|
/**
|
|
* User Commands Test suite for testing out commands
|
|
* that would be run by users when using the application.
|
|
*/
|
|
describe('User Command Tests', () => {
|
|
// test capacity command
|
|
it('run modify-capacity command', () => {
|
|
|
|
})
|
|
|
|
it('run clear-user-channel-history command', () => {
|
|
|
|
})
|
|
|
|
it('run message-stream command', () => {
|
|
|
|
})
|
|
|
|
it('run message-style command', () => {
|
|
|
|
})
|
|
|
|
it('run thread command', () => {
|
|
|
|
})
|
|
|
|
it('run private-thread command', () => {
|
|
|
|
})
|
|
})
|
|
|
|
/**
|
|
* Admin Commands Test suite for running administrative
|
|
* commands with the application.
|
|
*/
|
|
describe('Admin Command Tests', () => {
|
|
it('run shutoff command', () => {
|
|
|
|
})
|
|
|
|
it('run toggle-chat command', () => {
|
|
|
|
})
|
|
}) |