mirror of
https://github.com/github/codeql-action
synced 2026-05-29 05:00:55 +03:00
Reset mocks in test so they don't leak into later test
This commit is contained in:
Generated
+3
-1
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user