Skip to content

gitflarePublicPartly agent-ready40

orbit-duel

Real-time two-player orbital combat game on Cloudflare Workers and Durable Objects.

main
Add the Apache-2.0 licence0413e56
JavaScript12 lines458 B
import test from 'node:test';import assert from 'node:assert/strict';import { ensureSchema } from '../src/leaderboard.ts'; test('leaderboard creates schema once per db', async () => {  const sql = [];  const db = { prepare: (q) => ({ q }), batch: async (l) => { sql.push(...l.map((x) => x.q)); } };  await ensureSchema(db); await ensureSchema(db);  assert.equal(sql.length, 3);  assert.ok(sql[0].startsWith('CREATE TABLE IF NOT EXISTS scores'));});