Skip to content

Commit

Permalink
fix: add another test that combines logical OR and logical AND in the…
Browse files Browse the repository at this point in the history
… same requires block
  • Loading branch information
petey committed Oct 25, 2017
1 parent 164ce4c commit a5a7a4d
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/lib/getWorkflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,41 @@ describe('getWorkflow', () => {
});
});

it('should handle logical OR and logial AND requires', () => {
const result = getWorkflow({
jobs: {
foo: { requires: ['~commit'] },
A: { requires: ['foo'] },
B: { requires: ['foo'] },
C: { requires: ['~A', '~B', 'D', 'E'] },
D: {},
E: {}
}
});

assert.deepEqual(result, {
nodes: [
{ name: '~pr' },
{ name: '~commit' },
{ name: 'foo' },
{ name: 'A' },
{ name: 'B' },
{ name: 'C' },
{ name: 'D' },
{ name: 'E' }
],
edges: [
{ src: '~commit', dest: 'foo' },
{ src: 'foo', dest: 'A' },
{ src: 'foo', dest: 'B' },
{ src: 'A', dest: 'C' },
{ src: 'B', dest: 'C' },
{ src: 'D', dest: 'C', join: true },
{ src: 'E', dest: 'C', join: true }
]
});
});

it('should handle joins', () => {
const result = getWorkflow({
jobs: {
Expand Down

0 comments on commit a5a7a4d

Please sign in to comment.