mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	test: Add additional context for failed test
This commit is contained in:
		@@ -202,7 +202,9 @@ describe('Search', () => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        function test(query: string, expectedResultCount: number) {
 | 
					        function test(query: string, expectedResultCount: number) {
 | 
				
			||||||
            const searchResults = searchService.findResultsWithQuery(query, searchContext);
 | 
					            const searchResults = searchService.findResultsWithQuery(query, searchContext);
 | 
				
			||||||
            expect(searchResults.length).toEqual(expectedResultCount);
 | 
					            expect(searchResults.length)
 | 
				
			||||||
 | 
					                .withContext(`While searching for ${query} got unexpected result: [${searchResults.join(", ")}]`)
 | 
				
			||||||
 | 
					                .toEqual(expectedResultCount);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (expectedResultCount === 1) {
 | 
					            if (expectedResultCount === 1) {
 | 
				
			||||||
                expect(becca_mocking.findNoteByTitle(searchResults, 'My note')).toBeTruthy();
 | 
					                expect(becca_mocking.findNoteByTitle(searchResults, 'My note')).toBeTruthy();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user