Skip to content

Commit

Permalink
test: ensure cwd is restored after each test (#604)
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Jun 20, 2020
1 parent 67c8b5f commit 0456d2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rules/__tests__/no-deprecated-functions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import rule, {

const ruleTester = new TSESLint.RuleTester();

// pin the original cwd so that we can restore it after each test
const projectDir = process.cwd();

afterEach(() => process.chdir(projectDir));

/**
* Makes a new temp directory, prefixed with `eslint-plugin-jest-`
*
Expand Down

0 comments on commit 0456d2e

Please sign in to comment.