diff options
| author | stonedDiscord <Tukz@gmx.de> | 2026-01-01 16:37:47 +0100 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2026-01-01 16:37:47 +0100 |
| commit | 3e17eb9e5695fdf64f125914ee60c26ac7d96d12 (patch) | |
| tree | b2f4cc58aa67ff5f758d92b85d49bead72156036 | |
| parent | 6cac3d30e4c59c3b97935de747e4984189c1acf5 (diff) | |
url
| -rw-r--r-- | webAO/__tests__/isLowMemory.test.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/webAO/__tests__/isLowMemory.test.ts b/webAO/__tests__/isLowMemory.test.ts index b32d22e..1101e48 100644 --- a/webAO/__tests__/isLowMemory.test.ts +++ b/webAO/__tests__/isLowMemory.test.ts @@ -1,5 +1,6 @@ import { isLowMemory } from '../client/isLowMemory'; import { setOldLoading } from '../client'; +import { AO_HOST, setAOhost } from '../client/aoHost'; // Mock the setOldLoading function and prevent any network requests jest.mock('../client', () => ({ @@ -8,10 +9,17 @@ jest.mock('../client', () => ({ // Mock any potential network requests jest.mock('../services/request', () => ({ + __esModule: true, + default: jest.fn().mockResolvedValue(''), request: jest.fn().mockResolvedValue(''), requestBuffer: jest.fn().mockResolvedValue(new ArrayBuffer(0)), })); +// Set AO_HOST to a valid URL before tests run +beforeAll(() => { + setAOhost('https://example.com/'); +}); + describe('isLowMemory', () => { beforeEach(() => { // Reset mock before each test to ensure isolation |
