Publish curated ForgeFlow source from 2ed1787c0b52
This commit is contained in:
commit
f60b269686
254 files changed
+46204
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import validation from '../src/shared/validation.cjs';
|
||||
|
||||
const { normalizeBaseUrl, assertCommitMessage, assertDeploymentRequest, assertHttpUrl } = validation;
|
||||
|
||||
test('normalizes Gitea base URL', () => {
|
||||
assert.equal(normalizeBaseUrl('https://gitea.example.com/'), 'https://gitea.example.com');
|
||||
});
|
||||
|
||||
test('rejects blank commit messages', () => {
|
||||
assert.throws(() => assertCommitMessage(' '), /commit message/i);
|
||||
});
|
||||
|
||||
test('requires exact SHA and workflow profile', () => {
|
||||
assert.throws(() => assertDeploymentRequest({ branch: 'main', workflowFile: 'deploy.yml' }, 'nope'), /commit SHA/i);
|
||||
});
|
||||
|
||||
test('accepts Unraid DockerMan WebUI placeholders only when explicitly enabled', () => {
|
||||
assert.equal(assertHttpUrl('http://[IP]:[PORT:1223]/', { allowUnraidTemplate: true }), 'http://[IP]:[PORT:1223]/');
|
||||
assert.throws(() => assertHttpUrl('http://[IP]:[PORT:1223]/'));
|
||||
});
|
||||
Reference in new issue
Block a user