mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
parent
dfe7c4652f
commit
1770efad63
|
@ -7,7 +7,7 @@ export default class EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.listeners[event].has(cb)) {
|
if (this.listeners[event].has(cb)) {
|
||||||
throw new Error(`The listener already exising in event: ${event}`)
|
throw new Error(`Listener already exists for router event: \`${event}\``)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.listeners[event].add(cb)
|
this.listeners[event].add(cb)
|
||||||
|
|
|
@ -69,7 +69,7 @@ describe('EventEmitter', () => {
|
||||||
|
|
||||||
const run = () => ev.on('sample', cb)
|
const run = () => ev.on('sample', cb)
|
||||||
|
|
||||||
expect(run).toThrow(/The listener already exising in event: sample/)
|
expect(run).toThrow(/Listener already exists for router event: `sample`/)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should support chaining like the nodejs EventEmitter', () => {
|
it('should support chaining like the nodejs EventEmitter', () => {
|
||||||
|
|
Loading…
Reference in a new issue