Skip to content
Closed
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: 1 addition & 1 deletion d1.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
4 changes: 2 additions & 2 deletions worker.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down