Initial import

This commit is contained in:
how2ice
2026-04-21 03:33:23 +09:00
commit 9e4b70f1f1
495 changed files with 94680 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { shouldPersistNotFoundErrorLog } from './not-found.js';
test('shouldPersistNotFoundErrorLog only keeps work-server API paths', () => {
assert.equal(shouldPersistNotFoundErrorLog('/api'), true);
assert.equal(shouldPersistNotFoundErrorLog('/api/notifications/preferences/automation'), true);
assert.equal(shouldPersistNotFoundErrorLog('/api/notifications/preferences/automation?targetKind=client&targetId=abc'), true);
assert.equal(shouldPersistNotFoundErrorLog('/api/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'), false);
assert.equal(shouldPersistNotFoundErrorLog('/api/1234567890abcdef1234567890abcdef'), false);
assert.equal(shouldPersistNotFoundErrorLog('/api/docs'), false);
assert.equal(shouldPersistNotFoundErrorLog('/api/docs/index.html'), false);
assert.equal(shouldPersistNotFoundErrorLog('/api/env'), false);
assert.equal(shouldPersistNotFoundErrorLog('/api/config'), false);
assert.equal(shouldPersistNotFoundErrorLog('/api/debug'), false);
assert.equal(shouldPersistNotFoundErrorLog('/api/debug/pprof'), false);
assert.equal(shouldPersistNotFoundErrorLog('/api/.env'), false);
assert.equal(shouldPersistNotFoundErrorLog('/api/.git/config'), false);
assert.equal(shouldPersistNotFoundErrorLog('/apis/components'), false);
assert.equal(shouldPersistNotFoundErrorLog('/apis/widgets?widgetId=dashboard-report-card'), false);
assert.equal(shouldPersistNotFoundErrorLog('/plans/release-review'), false);
});