diff --git a/packages/i18n/src/index.mjs b/packages/i18n/src/index.mjs index 67c1c18a0183..bfabf1f2ee41 100644 --- a/packages/i18n/src/index.mjs +++ b/packages/i18n/src/index.mjs @@ -101,7 +101,7 @@ const languages = files.map((file) => path.basename(file, '.i18n.json')); // write the files if (fs.existsSync(`./dist`)) { - fs.rmSync(`./dist`, { recursive: true }); + fs.rmSync(`./dist`, { recursive: true, force: true }); } fs.mkdirSync(`./dist`, { recursive: true }); diff --git a/packages/i18n/src/index.spec.mjs b/packages/i18n/src/index.spec.mjs index b3efdaa10175..4e088186e295 100644 --- a/packages/i18n/src/index.spec.mjs +++ b/packages/i18n/src/index.spec.mjs @@ -10,7 +10,7 @@ describe('i18n', () => { jest.spyOn(fs, 'writeFileSync').mockImplementation(() => {}); jest.spyOn(fs, 'readFileSync').mockImplementation(() => JSON.stringify({})); jest.spyOn(fs, 'existsSync').mockReturnValue(true); - jest.spyOn(fs, 'rmdirSync').mockImplementation(() => {}); + jest.spyOn(fs, 'rmSync').mockImplementation(() => {}); }); afterEach(() => {