diff --git a/tests/renderStream.spec.ts b/tests/renderStream.spec.ts index b676cf6..4544cb8 100644 --- a/tests/renderStream.spec.ts +++ b/tests/renderStream.spec.ts @@ -1,5 +1,5 @@ import type {EChartsOption} from 'echarts'; -import fs from 'node:fs'; +import fs, {readFile} from 'node:fs'; import {ConfigService} from 'app/config'; import {renderStream} from 'app/renderStream'; @@ -7,6 +7,13 @@ import {RenderData} from 'app/types'; jest.mock('node:fs'); +jest.mock('node:fs', () => { + return { + ...jest.requireActual('node:fs'), + readFile: jest.fn(), + }; +}); + describe('renderStream', () => { it('can render graphs given a valid config and render data', async () => { const config = new ConfigService('./example');