add mention tests
This commit is contained in:
		
							parent
							
								
									54b0356a72
								
							
						
					
					
						commit
						a8bb3cc49b
					
				
					 1 changed files with 48 additions and 1 deletions
				
			
		|  | @ -95,7 +95,7 @@ const expectedResult3 = { | |||
| } | ||||
| 
 | ||||
| Deno.test({ | ||||
|   name: 'parse command arguments 3 (assertNotEquals)', | ||||
|   name: 'parse command arguments default value (assertNotEquals)', | ||||
|   fn: () => { | ||||
|     const result = parseArgs(commandArgs, messageArgs3) | ||||
|     assertNotEquals(result, expectedResult3) | ||||
|  | @ -104,3 +104,50 @@ Deno.test({ | |||
|   sanitizeResources: true, | ||||
|   sanitizeExit: true | ||||
| }) | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| const commandArgs2: Args[] = [ | ||||
|     { | ||||
|     name: 'user', | ||||
|     match: 'mentionUser' | ||||
|   }, | ||||
|   { | ||||
|     name: 'channel', | ||||
|     match: 'mentionChannel' | ||||
|   }, | ||||
|   { | ||||
|     name: 'role', | ||||
|     match: 'mentionRole', | ||||
|   }, | ||||
|   { | ||||
|     name: 'reason', | ||||
|     match: 'rest', | ||||
|     defaultValue: 'ree' | ||||
|   } | ||||
| 
 | ||||
| ] | ||||
| 
 | ||||
| const messageArgs4: string[] = [ | ||||
|   '<@!708544768342229012>', | ||||
|   'bye', | ||||
|   '<#783319033730564098>', | ||||
|   '<@&836715188690092032>' | ||||
| ] | ||||
| const expectedResult4 = { | ||||
|   channel: "783319033730564098", | ||||
|   role: "836715188690092032", | ||||
|   user: "708544768342229012", | ||||
|   reason: ["bye"] | ||||
| } | ||||
| 
 | ||||
| Deno.test({ | ||||
|   name: 'parse command arguments mentions (assertEquals)', | ||||
|   fn: () => { | ||||
|     const result = parseArgs(commandArgs2, messageArgs4) | ||||
|     assertEquals(result, expectedResult4) | ||||
|   }, | ||||
|   sanitizeOps: true, | ||||
|   sanitizeResources: true, | ||||
|   sanitizeExit: true | ||||
| }) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue