* 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>
17 lines
536 B
TypeScript
17 lines
536 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { clean } from '../src/utils/mentionClean'
|
|
import { getEnvVar } from '../src/utils'
|
|
|
|
/**
|
|
* MentionClean test suite, tests the clean function
|
|
*
|
|
* @param name name of the test suite
|
|
* @param fn function holding tests to run
|
|
*/
|
|
describe('#clean', () => {
|
|
// test for id removal from message
|
|
it('removes the mention from a message', () => {
|
|
const message = `<@${getEnvVar('CLIENT_UID')}> Hello, World!`
|
|
expect(clean(message)).toBe('Hello, World!')
|
|
})
|
|
}) |