mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-13 15:53:44 +08:00
Keep every post-59948b5 change inside verification/. The verifier owns its npm working directory and sanitized Docker context, so no release metadata or root Docker configuration is modified.
15 lines
539 B
TypeScript
15 lines
539 B
TypeScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
|
|
import { authenticationRequiredResponse } from '../../../lib/server/api-responses';
|
|
|
|
// GH-ISSUE: 204,226; GH-PR: 227
|
|
|
|
test('authenticationRequiredResponse returns a 401 JSON response', async () => {
|
|
const response = authenticationRequiredResponse();
|
|
|
|
assert.equal(response.status, 401);
|
|
assert.equal(response.headers.get('content-type')?.includes('application/json'), true);
|
|
assert.deepEqual(await response.json(), { error: 'Authentication required' });
|
|
});
|