mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	attribute parser and tests WIP
This commit is contained in:
		| @@ -25,6 +25,36 @@ export function expect(val) { | ||||
|  | ||||
|                 errorCount++; | ||||
|             } | ||||
|         }, | ||||
|         toBeFalsy: () => { | ||||
|             if (!!val) { | ||||
|                 console.trace("toBeFalsy failed."); | ||||
|                 console.error(`expected: null, false, undefined, 0 or empty string`); | ||||
|                 console.error(`got:      ${val}`); | ||||
|  | ||||
|                 errorCount++; | ||||
|             } | ||||
|         }, | ||||
|         toThrow: errorMessage => { | ||||
|             try { | ||||
|                 val(); | ||||
|             } | ||||
|             catch (e) { | ||||
|                 if (e.message !== errorMessage) { | ||||
|                     console.trace("toThrow caught exception, but messages differ"); | ||||
|                     console.error(`expected: ${errorMessage}`); | ||||
|                     console.error(`got:      ${e.message}`); | ||||
|  | ||||
|                     errorCount++; | ||||
|                 } | ||||
|  | ||||
|                 return; | ||||
|             } | ||||
|  | ||||
|             console.trace("toThrow did not catch any exception."); | ||||
|             console.error(`expected: ${errorMessage}`); | ||||
|             console.error(`got:      [none]`); | ||||
|             errorCount++; | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user