mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
add tests for EventBus
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
1fbd106412
commit
61d97197ec
14
src/common/__tests__/event-bus.test.ts
Normal file
14
src/common/__tests__/event-bus.test.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { appEventBus, AppEvent } from "../event-bus"
|
||||||
|
|
||||||
|
describe("event bus tests", () => {
|
||||||
|
describe("emit", () => {
|
||||||
|
it("emits an event", () => {
|
||||||
|
let event: AppEvent = null
|
||||||
|
appEventBus.on((ev: AppEvent) => {
|
||||||
|
event = ev
|
||||||
|
})
|
||||||
|
appEventBus.emit({name: "foo", action: "bar"})
|
||||||
|
expect(event.name).toBe("foo")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
Reference in New Issue
Block a user