Skip to content

Commit

Permalink
Reset mocks in test so they don't leak into later test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Partington committed Jun 25, 2020
1 parent a19d19e commit 56292b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/config-utils.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/config-utils.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/config-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ test("Octokit not used when reading local config", async t => {
process.env['RUNNER_TEMP'] = tmpDir;
process.env['GITHUB_WORKSPACE'] = tmpDir;

const spyKit = sinon.spy(octokit, "Octokit");
const sandbox = sinon.createSandbox();
const spyKit = sandbox.spy(octokit, "Octokit");

const inputFileContents = `
name: my config
Expand All @@ -166,6 +167,7 @@ test("Octokit not used when reading local config", async t => {
setInput('config-file', 'input');
await configUtils.loadConfig();
t.false(spyKit.called);
sandbox.restore();
});
});

Expand Down

0 comments on commit 56292b1

Please sign in to comment.