Skip to content

Commit c137cfc

Browse files
committed
♻️ Refactor event test files to use describe and test functions
1 parent 88a9ed5 commit c137cfc

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed
+11-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
import { test } from "vitest"
1+
import { describe, test } from "vitest"
22
import { isPrEventKey } from "./event.js"
33

4-
test("isPrEventKey", ({ expect }) => {
5-
const result = isPrEventKey("pr:comment:added")
6-
expect(result).toBe(true)
4+
describe("isPrEventKey", () => {
5+
test("pr:comment:added", ({ expect }) => {
6+
const result = isPrEventKey("pr:comment:added")
7+
expect(result).toBe(true)
8+
})
9+
10+
test("project:modified", ({ expect }) => {
11+
const result = isPrEventKey("project:modified")
12+
expect(result).toBe(false)
13+
})
714
})
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
import { test } from "vitest"
1+
import { describe, test } from "vitest"
22
import { isProjectEventKey } from "./event.js"
33

4-
test("isProjectEventKey", ({ expect }) => {
5-
const result = isProjectEventKey("project:modified")
6-
expect(result).toBe(true)
4+
describe("isProjectEventKey", () => {
5+
test("project:modified", ({ expect }) => {
6+
const result = isProjectEventKey("project:modified")
7+
expect(result).toBe(true)
8+
})
9+
10+
test("mirror:repo_synchronized", ({ expect }) => {
11+
const result = isProjectEventKey("mirror:repo_synchronized")
12+
expect(result).toBe(false)
13+
})
714
})
+11-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
import { test } from "vitest"
1+
import { describe, test } from "vitest"
22
import { isRepoEventKey } from "./event.js"
33

4-
test("isRepoEventKey", ({ expect }) => {
5-
const result = isRepoEventKey("mirror:repo_synchronized")
6-
expect(result).toBe(true)
4+
describe("isRepoEventKey", () => {
5+
test("mirror:repo_synchronized", ({ expect }) => {
6+
const result = isRepoEventKey("mirror:repo_synchronized")
7+
expect(result).toBe(true)
8+
})
9+
10+
test("project:modified", ({ expect }) => {
11+
const result = isRepoEventKey("project:modified")
12+
expect(result).toBe(false)
13+
})
714
})

0 commit comments

Comments
 (0)