Skip to content

Commit 4fd4572

Browse files
committed
feat(ci): add unit tests
1 parent 9724092 commit 4fd4572

5 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/test_and_deploy_docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
- uses: oven-sh/setup-bun@v2
1919
- name: Install Dependencies
2020
run: bun install
21+
- name: Ru unit tests
22+
run: bun run test
2123
- name: Build
2224
run: bun run build
2325
- name: Build TypeDoc

bunfig.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[test]
2+
3+
coverageReporter = ["text", "lcov"]
4+
coverageDir = "apps/docs/build/coverage"
5+
coverageSkipTestFiles = true

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"build:wave": "bun run --filter \"./packages/wave\" build",
77
"build:kit": "bun run --filter \"./packages/kit\" build",
88
"build:docs": "bun run --filter \"./apps/docs\" build",
9+
"test": "bun test --coverage",
910
"lint": "bunx --bun biome check .",
1011
"format": "bunx --bun biome check --write --unsafe ."
1112
},

packages/kit/src/server.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { expect, it } from "bun:test";
22
import path from "node:path";
33
import { buildRoutes, createWaveKit } from "./server";
44

5-
const TEST_DIR = path.join(process.cwd(), "test", "app");
5+
const TEST_DIR = path.join(__dirname, "..", "test", "app");
66

77
const FAKE_ROUTES = {
8-
"/": path.join(TEST_DIR, "test.ts"),
8+
"/": path.join(TEST_DIR, "index.test.ts"),
99
};
1010

1111
it("should prepare routes", async () => {
@@ -15,5 +15,5 @@ it("should prepare routes", async () => {
1515

1616
it("should create wavekit config", async () => {
1717
const routes = await createWaveKit({ routesDir: TEST_DIR });
18-
expect(routes["/test"]).toHaveProperty("GET");
18+
expect(routes["/index.test"]).toHaveProperty("GET");
1919
});

0 commit comments

Comments
 (0)