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';