Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.
TypeScript
import * as assert from 'node:assert/strict'
import { test } from 'node:test'
import { normalizeCustomUrl } from '../../app/validators/system.js'
test('rejects a normalized custom URL that exceeds the database column size', () => {
const tooLongHost = 'a'.repeat(247)
assert.equal(normalizeCustomUrl(`https://${tooLongHost}`), null)
})
test('accepts a normalized custom URL at the database column limit', () => {
const maxLengthHost = 'a'.repeat(246)
const normalized = normalizeCustomUrl(`https://${maxLengthHost}`)
assert.equal(normalized?.length, 255)
})