extend test
This commit is contained in:
parent
bffead6680
commit
1c9d17263b
1 changed files with 13 additions and 0 deletions
|
@ -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']
|
||||||
|
|
Loading…
Reference in a new issue