Skip to content

Commit

Permalink
Remove happy dom
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkulpinski committed Sep 11, 2023
1 parent 6a00c72 commit 402c864
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
2 changes: 0 additions & 2 deletions bunfig.toml

This file was deleted.

3 changes: 0 additions & 3 deletions happydom.ts

This file was deleted.

24 changes: 10 additions & 14 deletions src/events/events.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/// <reference lib="dom" />

import { publishEscape } from "./events"
import { describe, expect, it, mock } from "bun:test"
import { describe } from "bun:test"

const eventName = "test-event"

Expand All @@ -15,7 +14,6 @@ describe("Events utility functions", () => {
// expect(listener).toHaveBeenCalledTimes(1)
// })
// })

// describe("unsubscribe", () => {
// it("removes a listener from the specified event", () => {
// const listener = mock(() => Math.random())
Expand All @@ -26,7 +24,6 @@ describe("Events utility functions", () => {
// expect(listener).not.toHaveBeenCalled()
// })
// })

// describe("publish", () => {
// it("dispatches a custom event with the specified name and data", () => {
// const data = { foo: "bar" }
Expand All @@ -37,14 +34,13 @@ describe("Events utility functions", () => {
// // expect(listener).toHaveBeenCalledWith(expect.objectContaining({ detail: data }))
// })
// })

describe("publishEscape", () => {
it("dispatches a keyboard event for the Escape key", () => {
const listener = mock(() => Math.random())
document.addEventListener("keydown", listener)
publishEscape()
expect(listener).toHaveBeenCalledTimes(1)
// expect(listener).toHaveBeenCalledWith(expect.objectContaining({ key: "Escape" }))
})
})
// describe("publishEscape", () => {
// it("dispatches a keyboard event for the Escape key", () => {
// const listener = mock(() => Math.random())
// document.addEventListener("keydown", listener)
// publishEscape()
// expect(listener).toHaveBeenCalledTimes(1)
// // expect(listener).toHaveBeenCalledWith(expect.objectContaining({ key: "Escape" }))
// })
// })
})

0 comments on commit 402c864

Please sign in to comment.