Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/VisionService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ jest.mock('child_process', () => {
};
});

// On macOS the real ModelMemoryManager reads available memory through a
// background `sysctl` spawn, which the spawn mock above would count as the
// vision runtime starting. Read os.freemem() on every platform instead.
jest.mock('../src/main/utils/systemMemory', () => ({
getAvailableMemoryBytes: jest.fn(async () => require('os').freemem()),
peekAvailableMemoryBytes: jest.fn(() => require('os').freemem())
}));

// Mock adm-zip and tar (not needed in unit tests)
jest.mock('adm-zip', () => jest.fn());
jest.mock('tar', () => ({ x: jest.fn() }));
Expand Down
Loading