Reset mocks in test so they don't leak into later test

This commit is contained in:
Sam Partington
2020-06-25 14:58:53 +01:00
parent a19d19e0a3
commit 56292b1fa3
3 changed files with 7 additions and 3 deletions

View File

@@ -135,7 +135,8 @@ ava_1.default("Octokit not used when reading local config", async (t) => {
return await util.withTmpDir(async (tmpDir) => {
process.env['RUNNER_TEMP'] = tmpDir;
process.env['GITHUB_WORKSPACE'] = tmpDir;
const spyKit = sinon_1.default.spy(octokit, "Octokit");
const sandbox = sinon_1.default.createSandbox();
const spyKit = sandbox.spy(octokit, "Octokit");
const inputFileContents = `
name: my config
disable-default-queries: true
@@ -150,6 +151,7 @@ ava_1.default("Octokit not used when reading local config", async (t) => {
setInput('config-file', 'input');
await configUtils.loadConfig();
t.false(spyKit.called);
sandbox.restore();
});
});
ava_1.default("Remote and local configuration paths correctly identified", t => {