From 3eb3533f9aa24205a10f8a4c152b4b06a9728372 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Oct 2026 13:29:19 +0000 Subject: [PATCH] Point tests at the flat file layout npm test looked for test/*.test.mjs and the tests imported from ../src/, so it ran 0 tests after the files were uploaded to the repo root. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Pf84v97TVCpcgwPh8HShvu --- d1.mjs | 2 +- package.json | 2 +- worker.test.mjs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/d1.mjs b/d1.mjs index beacfd6..2aa9b92 100644 --- a/d1.mjs +++ b/d1.mjs @@ -20,7 +20,7 @@ class Stmt { async all(){ return { results: this._prep().all(...this.args), success: true }; } } -export function makeD1(schemaPath = new URL('../schema.sql', import.meta.url)){ +export function makeD1(schemaPath = new URL('./schema.sql', import.meta.url)){ const db = new DatabaseSync(':memory:'); db.exec(readFileSync(schemaPath, 'utf8')); return { diff --git a/package.json b/package.json index fa9251b..7c7e0ff 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "type": "module", "scripts": { - "test": "node --no-warnings --test test/*.test.mjs", + "test": "node --no-warnings --test *.test.mjs", "dev": "wrangler dev", "deploy": "wrangler deploy" } diff --git a/worker.test.mjs b/worker.test.mjs index 313b71f..9412d03 100644 --- a/worker.test.mjs +++ b/worker.test.mjs @@ -2,8 +2,8 @@ in-memory SQLite standing in for D1. No wrangler, no network. */ import { test } from 'node:test'; import assert from 'node:assert/strict'; -import { handleRequest, originAllowed, redirectAllowed, memoryLimit, _resetMemoryLimit } from '../src/worker.js'; -import { signJWT, verifyJWT, mintSession, b64uEncode, emailAllowed } from '../src/auth.js'; +import { handleRequest, originAllowed, redirectAllowed, memoryLimit, _resetMemoryLimit } from './worker.js'; +import { signJWT, verifyJWT, mintSession, b64uEncode, emailAllowed } from './auth.js'; import { makeD1 } from './d1.mjs'; const ORIGIN = 'https://tangent.fit';