Reset mocks in test so they don't leak into later test
This commit is contained in:
parent
a19d19e0a3
commit
56292b1fa3
3 changed files with 7 additions and 3 deletions
4
lib/config-utils.test.js
generated
4
lib/config-utils.test.js
generated
|
|
@ -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 => {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -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
|
||||
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue