21 lines
638 B
Lua
21 lines
638 B
Lua
describe('compact', function()
|
|
it('produces an error if its parent errors', function()
|
|
local observable = Rx.Observable.of(''):map(function(x) return x() end)
|
|
expect(observable).to.produce.error()
|
|
expect(observable:compact()).to.produce.error()
|
|
end)
|
|
|
|
it('does not produce values that are false or nil', function()
|
|
local observable = Rx.Observable.create(function(observer)
|
|
observer:onNext(nil)
|
|
observer:onNext(true)
|
|
observer:onNext(false)
|
|
observer:onNext('')
|
|
observer:onNext(0)
|
|
observer:onCompleted()
|
|
end)
|
|
|
|
expect(observable:compact()).to.produce(true, '', 0)
|
|
end)
|
|
end)
|