Skip to content

Commit

Permalink
split out new test for rule/example in rerun formatter spec
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgoss committed Mar 17, 2020
1 parent 3bdc7d7 commit beb1d57
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/formatter/rerun_formatter_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,31 @@ describe('RerunFormatter', () => {
data: 'Feature: a\nScenario: b\nGiven a step',
uri: 'a.feature',
},
{
data: 'Feature: a\n\nScenario: b\nGiven a step',
uri: 'b.feature',
},
]

// Act
const output = await testFormatter({
parsedArgvOptions,
sources,
type: 'rerun',
})

// Assert
expect(output).to.eql(`a.feature:2${separator.expected}b.feature:3`)
})

it('outputs the reference needed to run the rule example again', async () => {
// Arrange
const parsedArgvOptions = { rerun: { separator: separator.opt } }
const sources = [
{
data: 'Feature: a\nRule: b\nExample: c\nGiven a step',
uri: 'a.feature',
},
{
data: 'Feature: a\n\nRule: b\nExample: c\nGiven a step',
uri: 'b.feature',
Expand All @@ -193,7 +218,7 @@ describe('RerunFormatter', () => {
})

// Assert
expect(output).to.eql(`a.feature:2${separator.expected}b.feature:4`)
expect(output).to.eql(`a.feature:3${separator.expected}b.feature:4`)
})
})
}
Expand Down

0 comments on commit beb1d57

Please sign in to comment.