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
17 changes: 10 additions & 7 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
steps:
- uses: haliphax/narf/.github@main

- name: Install Chrome
run: npx @puppeteer/browsers install chrome@stable

- name: Cypress
env:
host: 0.0.0.0
Expand All @@ -51,23 +54,23 @@ jobs:
npm run build
npm start &>/dev/null &
sleep 3
npm run e2e
npm run e2e -- -b chrome

eslint:
oxlint:
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main

- name: ESLint
run: npx eslint .
- name: oxlint
run: npx oxlint .

prettier:
oxfmt:
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main

- name: Prettier
run: npx prettier -lu .
- name: oxfmt
run: npx oxfmt --no-error-on-unmatched-pattern .

unit-tests:
name: Unit tests
Expand Down
5 changes: 1 addition & 4 deletions .husky/scripts/no-commit-to-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import child_process from "node:child_process";

if (process.env.ALLOW_MAIN) process.exit(0);

const branch = child_process
.execSync("git branch --show-current")
.toString()
.trim();
const branch = child_process.execSync("git branch --show-current").toString().trim();

if (branch === "main") {
process.stderr.write("❌ Do not commit to main branch\n");
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/jod
lts/krypton
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ CHANGELOG.md
package-lock.json
/db/
/dist/
**/*.*ts
**/*.*js
**/*.vue
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax = docker/dockerfile:1

FROM node:22-slim AS base
FROM node:24-slim AS base
LABEL fly_launch_runtime="Node.js"
WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/profile.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe("user profile", () => {
it("processes updates", () => {
cy.visit("http://localhost:3000", {})
cy.visit("http://localhost:3000")
.get("details[open]")
.get("#name")
.should("be.visible")
Expand Down
25 changes: 17 additions & 8 deletions cypress/e2e/story.cy.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
Cypress.automation("remote:debugger:protocol", {
command: "Browser.grantPermissions",
params: {
permissions: ["clipboardReadWrite", "clipboardSanitizedWrite"],
origin: window.location.origin,
},
});

describe("story interface", () => {
it("creates, votes, reveals", () => {
cy.visit("http://localhost:3000", {})
.get("#title")
.should("be.visible")
.type("Lifecycle test{enter}")
.location()
.should("match", /\/[%a-zA-Z0-9]+/)
.location("pathname")
.should("match", /\/[a-zA-Z0-9]+/)
.get('button[title="Vote 1"]')
.click()
.location()
.location("href")
.then((l) => {
cy.clearAllLocalStorage()
.visit(l.href)
.visit(l)
.get('button[title="Vote 2"]')
.should("be.visible")
.click()
Expand All @@ -36,10 +44,11 @@ describe("story interface", () => {
.get("#title")
.should("be.visible")
.type("Share test{enter}")
.location()
.should("match", /\/[%a-zA-Z0-9]+/)
.location("pathname")
.should("match", /\/[a-zA-Z0-9]+/)
.location("href")
.then((l) => {
cy.visit(l.href)
cy.visit(l)
.get("button")
.filter((_, e) => e.textContent.includes("Share"))
.should("be.visible")
Expand All @@ -50,7 +59,7 @@ describe("story interface", () => {
.window()
.then(async (win) => {
const clipped = await win.navigator.clipboard.readText();
expect(clipped).to.eq(l.href);
expect(clipped).to.eq(l);
});
});
});
Expand Down
Loading
Loading