|
1 | | -const resetWorkflow = require("../../src/workflows/dev"); |
2 | | -const run = require("../../src/workflows/steps"); |
3 | | - |
4 | 1 | describe("dev workflow", () => { |
5 | | - it("should have all of the required steps", () => { |
6 | | - expect(resetWorkflow).toEqual([ |
7 | | - run.fetchUpstream, |
8 | | - run.gitCreateBranchOrigin, |
9 | | - run.checkoutBaseBranch, |
10 | | - run.rebaseUpstreamBaseBranch, |
11 | | - run.checkoutWorkingBranch, |
12 | | - run.gitCreateBranchUpstream, |
13 | | - run.githubUpstream, |
14 | | - run.githubOrigin, |
15 | | - run.updatePullRequestTitle, |
16 | | - run.addLKId, |
17 | | - run.updatePullRequestBody, |
18 | | - run.createGithubPullRequestAganistBranch |
19 | | - ]); |
| 2 | + let resetWorkflow; |
| 3 | + describe("has LK scope", () => { |
| 4 | + beforeEach(() => { |
| 5 | + jest.resetModules(); |
| 6 | + jest.doMock("../../src/utils", () => ({ |
| 7 | + hasLkScope: jest.fn(() => true) |
| 8 | + })); |
| 9 | + |
| 10 | + resetWorkflow = require("../../src/workflows/dev"); |
| 11 | + }); |
| 12 | + |
| 13 | + it("should have all of the required steps", () => { |
| 14 | + expect(resetWorkflow.length).toEqual(12); |
| 15 | + }); |
| 16 | + }); |
| 17 | + |
| 18 | + describe("doesn't have LK scope", () => { |
| 19 | + beforeEach(() => { |
| 20 | + jest.resetModules(); |
| 21 | + jest.doMock("../../src/utils", () => ({ |
| 22 | + hasLkScope: jest.fn(() => false) |
| 23 | + })); |
| 24 | + |
| 25 | + resetWorkflow = require("../../src/workflows/dev"); |
| 26 | + }); |
| 27 | + |
| 28 | + it("should have all of the required steps", () => { |
| 29 | + expect(resetWorkflow.length).toEqual(11); |
| 30 | + }); |
20 | 31 | }); |
21 | 32 | }); |
0 commit comments