Fixing unit test reduce() failure that doesn't happen locally

This commit is contained in:
Jason Axley 2025-08-27 17:56:37 -07:00
parent 6b11da158e
commit 7d08b10971

View File

@ -10,7 +10,8 @@ async function loadTestDatabase(mockFileInfo) {
let libraryItem1Id, libraryItem2Id let libraryItem1Id, libraryItem2Id
let fileInfo = mockFileInfo || getMockFileInfo() let fileInfo = mockFileInfo || getMockFileInfo()
let bookLibraryFiles = fileInfo.keys().reduce((acc, key) => { // mapping the keys() iterable to an explicit array so reduce() should work consistently.
let bookLibraryFiles = [...fileInfo.keys()].reduce((acc, key) => {
let bookfile = new LibraryFile() let bookfile = new LibraryFile()
bookfile.setDataFromPath(key, key) bookfile.setDataFromPath(key, key)
acc.push(bookfile) acc.push(bookfile)