16 lines
581 B
JavaScript
16 lines
581 B
JavaScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { isKnownSitePath } from '../server/study-helpers.js'
|
|
|
|
test('real site pages are known paths', () => {
|
|
for (const p of ['/', '/study', '/study/titus/titus-abc', '/episodes/123', '/salvation', '/scripture', '/privacy']) {
|
|
assert.equal(isKnownSitePath(p), true, p)
|
|
}
|
|
})
|
|
|
|
test('scanner and probe paths are not known paths', () => {
|
|
for (const p of ['/.env', '/.git/config', '/wp-login', '/actuator/health', '/cgi-bin/x', '/random-path-123']) {
|
|
assert.equal(isKnownSitePath(p), false, p)
|
|
}
|
|
})
|