mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
test: Add additional context for failed test
This commit is contained in:
parent
80d2a69f47
commit
9dc22264f4
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user