diff --git a/packages/eslint-plugin/src/no-forbidden-package-imports.test.ts b/packages/eslint-plugin/src/no-forbidden-package-imports.test.ts index 349b71319f..c46f82f4fc 100644 --- a/packages/eslint-plugin/src/no-forbidden-package-imports.test.ts +++ b/packages/eslint-plugin/src/no-forbidden-package-imports.test.ts @@ -25,6 +25,11 @@ const ERR = (name: string, path: string) => ({ message: `${name} does not export ${path}`, }); +// cwd must be restored +const origDir = process.cwd(); +afterAll(() => { + process.chdir(origDir); +}); process.chdir(FIXTURE); const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/src/no-relative-monorepo-imports.test.ts b/packages/eslint-plugin/src/no-relative-monorepo-imports.test.ts index 6888d258cc..31e1674b76 100644 --- a/packages/eslint-plugin/src/no-relative-monorepo-imports.test.ts +++ b/packages/eslint-plugin/src/no-relative-monorepo-imports.test.ts @@ -28,6 +28,11 @@ const ERR_FORBIDDEN = (newImp: string) => ({ message: `Relative imports of monorepo packages are forbidden, use '${newImp}' instead`, }); +// cwd must be restored +const origDir = process.cwd(); +afterAll(() => { + process.chdir(origDir); +}); process.chdir(FIXTURE); const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/src/no-undeclared-imports.test.ts b/packages/eslint-plugin/src/no-undeclared-imports.test.ts index e92d422057..29e2c3a87c 100644 --- a/packages/eslint-plugin/src/no-undeclared-imports.test.ts +++ b/packages/eslint-plugin/src/no-undeclared-imports.test.ts @@ -53,6 +53,11 @@ const ERR_SWITCH_BACK = () => ({ message: 'Switch back to import declaration', }); +// cwd must be restored +const origDir = process.cwd(); +afterAll(() => { + process.chdir(origDir); +}); process.chdir(FIXTURE); const ruleTester = new RuleTester({