Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Test that nested components are permitted to log data when sequence i…
Browse files Browse the repository at this point in the history
…s cancelled
  • Loading branch information
FelixHenninger committed May 7, 2017
1 parent f2c6272 commit acbabb5
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions library/test/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe('Flow control', () => {

describe('prepare_nested', () => {
// This is not ideal because the function
// is not tested directly. However, the function
// is not tested directly. Then again, it
// is not public, so it's difficult to test
// directly

Expand Down Expand Up @@ -187,7 +187,22 @@ describe('Flow control', () => {
})
})

it('Abort does not trigger outstanding components', () => {
it('permits terminated component to log data', () => {
const a = new lab.core.Component({ data: { foo: 'bar' } })
s.options.content = [a]
s.options.datastore = new lab.data.Store()

return s.run().then(() => {
return s.end()
}).then(() => {
assert.equal(
s.options.datastore.get('foo'),
'bar',
)
})
})

it('abort does not trigger outstanding components', () => {
// Setup sequence
const a = new lab.core.Component()
const b = new lab.core.Component()
Expand Down Expand Up @@ -429,7 +444,6 @@ describe('Flow control', () => {
b3.end()
assert.equal(p.progress, 1)
})

})

})

0 comments on commit acbabb5

Please sign in to comment.