extend test

This commit is contained in:
mierenmanz 2021-04-28 21:28:09 +02:00
parent bffead6680
commit 1c9d17263b

View file

@ -6,6 +6,10 @@ import {
// debugger // debugger
const commandArgs: Args[] = [ const commandArgs: Args[] = [
{
name: 'originalMessage',
match: 'content'
},
{ {
name: 'permaban', name: 'permaban',
match: 'flag', match: 'flag',
@ -31,12 +35,20 @@ const messageArgs1: string[] = [
'Skyler' 'Skyler'
] ]
const expectedResult1 = { const expectedResult1 = {
originalMessage: [
'<@!708544768342229012>',
'--permanent',
'bye',
'bye',
'Skyler'
],
permaban: true, permaban: true,
user: '708544768342229012', user: '708544768342229012',
reason: ['bye', 'bye', 'Skyler'] reason: ['bye', 'bye', 'Skyler']
} }
Deno.test({ Deno.test({
only: false,
name: 'parse command arguments 1 (assertEquals)', name: 'parse command arguments 1 (assertEquals)',
fn: () => { fn: () => {
const result = parseArgs(commandArgs, messageArgs1) const result = parseArgs(commandArgs, messageArgs1)
@ -54,6 +66,7 @@ const messageArgs2: string[] = [
'Skyler' 'Skyler'
] ]
const expectedResult2 = { const expectedResult2 = {
originalMessage: ['<@!708544768342229012>', 'bye', 'bye', 'Skyler'],
permaban: true, permaban: true,
user: '708544768342229012', user: '708544768342229012',
reason: ['bye', 'bye', 'Skyler'] reason: ['bye', 'bye', 'Skyler']