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

Commit acbabb5

Browse files
Test that nested components are permitted to log data when sequence is cancelled
1 parent f2c6272 commit acbabb5

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

library/test/flow.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ describe('Flow control', () => {
22

33
describe('prepare_nested', () => {
44
// This is not ideal because the function
5-
// is not tested directly. However, the function
5+
// is not tested directly. Then again, it
66
// is not public, so it's difficult to test
77
// directly
88

@@ -187,7 +187,22 @@ describe('Flow control', () => {
187187
})
188188
})
189189

190-
it('Abort does not trigger outstanding components', () => {
190+
it('permits terminated component to log data', () => {
191+
const a = new lab.core.Component({ data: { foo: 'bar' } })
192+
s.options.content = [a]
193+
s.options.datastore = new lab.data.Store()
194+
195+
return s.run().then(() => {
196+
return s.end()
197+
}).then(() => {
198+
assert.equal(
199+
s.options.datastore.get('foo'),
200+
'bar',
201+
)
202+
})
203+
})
204+
205+
it('abort does not trigger outstanding components', () => {
191206
// Setup sequence
192207
const a = new lab.core.Component()
193208
const b = new lab.core.Component()
@@ -429,7 +444,6 @@ describe('Flow control', () => {
429444
b3.end()
430445
assert.equal(p.progress, 1)
431446
})
432-
433447
})
434448

435449
})

0 commit comments

Comments
 (0)