Skip to content

Commit

Permalink
Don't confuse the test environment for a real Actions env
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreeman committed Nov 30, 2022
1 parent 97a5b4a commit e2bc8b3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ import { initRepository, addAndTrackRemote } from './helpers/git';

runTestsInScratchDirectory();

let originalOutput = process.env.GITHUB_OUTPUT;

beforeEach(async () => {
await initRepository(process.cwd());

fs.writeFileSync('package.json', JSON.stringify({ version: '1.2.3' }));
await execa('git', ['add', 'package.json']);
await execa('git', ['commit', '-m', 'Add package.json']);

delete process.env.GITHUB_OUTPUT;
});

afterEach(() => {
process.env.GITHUB_OUTPUT = originalOutput;
});

describe('with a changed version', () => {
Expand Down

0 comments on commit e2bc8b3

Please sign in to comment.