Initial import
This commit is contained in:
22
etc/servers/work-server/src/not-found.test.ts
Executable file
22
etc/servers/work-server/src/not-found.test.ts
Executable 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);
|
||||
});
|
||||
Reference in New Issue
Block a user