add ci/cd

This commit is contained in:
Meghdad committed 2026-11-01 20:18:19 +03:30
1 parent 22fe85bb92
commit ef3f134c1e
7 files changed
+248 -2

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { validateDeployment } from '../scripts/deploy-ci.mjs';
test('CI deployment fails before upload without an explicit existing project and HTTPS origin', () => {
const env = { VERCEL_TOKEN: 'synthetic-ci-token', VERCEL_ORG_ID: 'team_fixture', VERCEL_PROJECT_ID: 'prj_fixture', PRODUCTION_URL: 'https://example.com' };
assert.doesNotThrow(() => validateDeployment(env));
for (const key of Object.keys(env)) assert.throws(() => validateDeployment({ ...env, [key]: '' }), new RegExp(key));
for (const origin of ['http://example.com', 'https://example.com/', 'https://user:password@example.com']) assert.throws(() => validateDeployment({ ...env, PRODUCTION_URL: origin }));
assert.throws(() => validateDeployment({ ...env, VERCEL_PROJECT_ID: 'another-project' }));
});