Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Commit ba6b107

Browse files
committed
test(core): substitute use of fs.rmSync to node12 compatible
1 parent 1875c89 commit ba6b107

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/libs/core/tests/images/imageOptimizer.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import sharp from "sharp";
22
import { ImagesManifest, PlatformClient } from "../../src";
33
import { imageOptimizer } from "../../src/images/imageOptimizer";
44
import imagesManifest from "./image-images-manifest.json";
5-
import fs from "fs";
65
import url from "url";
76
import http from "http";
87
import Stream from "stream";
98
import { jest } from "@jest/globals";
9+
import fse from "fs-extra";
1010

1111
jest.mock("node-fetch", () => require("fetch-mock-jest").sandbox());
1212

@@ -128,8 +128,8 @@ describe("Image optimizer", () => {
128128
};
129129

130130
beforeEach(() => {
131-
fs.rmSync("/tmp/cache/images", { recursive: true, force: true });
132-
fs.rmSync("/tmp/cache/imageMeta", { recursive: true, force: true });
131+
fse.remove("/tmp/cache/images");
132+
fse.remove("/tmp/cache/imageMeta");
133133
});
134134

135135
describe("Routes", () => {

0 commit comments

Comments
 (0)