test for apply emit cancelling

This commit is contained in:
Evan You 2014-08-20 10:39:20 -04:00
parent c917988253
commit d7e0230c57
1 changed files with 11 additions and 0 deletions

View File

@ -62,4 +62,15 @@ describe('Emitter', function () {
expect(spy).toHaveBeenCalledWith(1, 2, 3, 4, 5)
})
it('apply emit cancel', function () {
expect(e._cancelled).toBe(false)
e.on('test', function () {
return false
})
e.applyEmit('test')
expect(e._cancelled).toBe(true)
e.applyEmit('other')
expect(e._cancelled).toBe(false)
})
})