mirror of
https://code.forgejo.org/actions/git-backporting.git
synced 2025-06-05 04:44:28 -04:00
test: fix process.argv reset during cli tests (#60)
This commit is contained in:
parent
49a7350406
commit
91782505ce
6 changed files with 15 additions and 18 deletions
|
@ -44,11 +44,11 @@ describe("cli args parser", () => {
|
|||
});
|
||||
|
||||
beforeEach(() => {
|
||||
// create a fresh new instance every time
|
||||
parser = new CLIArgsParser();
|
||||
|
||||
// reset process.env variables
|
||||
resetProcessArgs();
|
||||
|
||||
// create a fresh new instance every time
|
||||
parser = new CLIArgsParser();
|
||||
});
|
||||
|
||||
test("valid execution [default, short]", () => {
|
||||
|
|
|
@ -63,11 +63,12 @@ describe("github pull request config parser", () => {
|
|||
});
|
||||
|
||||
beforeEach(() => {
|
||||
mockGitHubClient("http://localhost/api/v3");
|
||||
|
||||
// reset process.env variables
|
||||
resetProcessArgs();
|
||||
|
||||
// mock octokit
|
||||
mockGitHubClient("http://localhost/api/v3");
|
||||
|
||||
// create a fresh new instance every time
|
||||
argsParser = new CLIArgsParser();
|
||||
configParser = new PullRequestConfigsParser();
|
||||
|
|
|
@ -45,6 +45,10 @@ afterAll(() => {
|
|||
});
|
||||
|
||||
beforeEach(() => {
|
||||
// reset process.env variables
|
||||
resetProcessArgs();
|
||||
|
||||
// mock octokit
|
||||
mockGitHubClient();
|
||||
|
||||
// create CLI arguments parser
|
||||
|
@ -54,11 +58,6 @@ beforeEach(() => {
|
|||
runner = new Runner(parser);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// reset process.env variables
|
||||
resetProcessArgs();
|
||||
});
|
||||
|
||||
describe("cli runner", () => {
|
||||
|
||||
test("with dry run", async () => {
|
||||
|
|
|
@ -60,6 +60,9 @@ afterAll(() => {
|
|||
});
|
||||
|
||||
beforeEach(() => {
|
||||
// reset process.env variables
|
||||
resetProcessArgs();
|
||||
|
||||
// create CLI arguments parser
|
||||
parser = new CLIArgsParser();
|
||||
|
||||
|
@ -67,13 +70,7 @@ beforeEach(() => {
|
|||
runner = new Runner(parser);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// reset process.env variables
|
||||
resetProcessArgs();
|
||||
});
|
||||
|
||||
describe("cli runner", () => {
|
||||
|
||||
test("with dry run", async () => {
|
||||
addProcessArgs([
|
||||
"-d",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue