Skip to content

Commit

Permalink
Explicitly import & assign actual 'join'
Browse files Browse the repository at this point in the history
  • Loading branch information
paescuj committed Nov 20, 2023
1 parent 2fc9d95 commit 3f7be84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/storage-driver-cloudinary/src/index.test.ts
Expand Up @@ -34,6 +34,8 @@ vi.mock('node:path');
vi.mock('node:crypto');
vi.mock('undici');

const { join: joinActual } = await vi.importActual<typeof import('node:path')>('node:path');

let sample: {
config: Required<DriverCloudinaryConfig>;
path: {
Expand Down Expand Up @@ -630,7 +632,7 @@ describe('#stat', () => {
status: 200,
};

vi.mocked(join).mockRestore();
vi.mocked(join).mockImplementation(joinActual);

vi.mocked(fetch).mockResolvedValue(mockResponse as unknown as Response);
});
Expand Down Expand Up @@ -1126,7 +1128,7 @@ describe('#uploadChunk', () => {

describe('#delete', () => {
beforeEach(async () => {
vi.mocked(join).mockRestore();
vi.mocked(join).mockImplementation(joinActual);

await driver.delete(sample.path.input);
});
Expand Down

0 comments on commit 3f7be84

Please sign in to comment.