mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
test(spec/search): fix expect error message printing
adjusted message to be printed correctly and adjusted wording -> previously it was printing "[object object]", since we are dealing with an array of objects
This commit is contained in:
parent
c7e688b6e6
commit
c5d4df11a5
@ -184,7 +184,7 @@ describe("Search", () => {
|
||||
|
||||
function test(query: string, expectedResultCount: number) {
|
||||
const searchResults = searchService.findResultsWithQuery(query, searchContext);
|
||||
expect(searchResults.length, `While searching for ${query} got unexpected result: [${searchResults.join(", ")}]`)
|
||||
expect(searchResults.length, `Searching for '${query}' unexpectedly returned ${Number(searchResults?.length)} instead of ${expectedResultCount} results. SearchResult: '${JSON.stringify(searchResults)}'`)
|
||||
.toEqual(expectedResultCount);
|
||||
|
||||
if (expectedResultCount === 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user