Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/nodeci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:

- name: Install
run: make install
- name: Build assets
run: make build
- name: Run linter
run: make lint
- name: Run tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
dist/
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
setup: install build

install:
pnpm install

build:
pnpm run build

start:
pnpm run start

Expand Down
11 changes: 11 additions & 0 deletions __tests__/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ describe("app", () => {
expect(svg).toContain("<svg");
});

// Сборка стилей проверяется прогоном, потому что её отказ выглядит как успех:
// vite отчитывается зелёным, `main.css` лежит на месте, а классов из
// pug-шаблонов в нём нет, и страница приходит без оформления.
it("GET /assets/main.css serves styles built from templates", async () => {
const res = await request(app).get("/assets/main.css");
expect(res.status).toBe(200);
expect(res.headers["content-type"]).toContain("text/css");
expect(res.text).toContain(".max-w-3xl");
expect(res.text).toContain(".bg-green-50");
});

it("POST /api/notes returns 422 for invalid payload", async () => {
const res = await request(app).post("/api/notes").send({});
expect(res.status).toBe(422);
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"scripts": {
"build": "vite build",
"start": "node bin/server.js",
"start:watch": "nodemon bin/server.js",
"test": "vitest run",
Expand All @@ -23,11 +24,14 @@
"pug": "*"
},
"devDependencies": {
"@tailwindcss/vite": "^4.3.3",
"nodemon": "^3.1.14",
"npm-check-updates": "^23.0.2",
"oxfmt": "^0.63.0",
"oxlint": "^1.78.0",
"supertest": "^7.2.2",
"tailwindcss": "^4.3.3",
"vite": "^8.2.2",
"vitest": "^4.0.15"
},
"packageManager": "pnpm@11.20.0"
Expand Down
Loading