summaryrefslogtreecommitdiff
path: root/archived/projt-launcher/ci/github-script/test/commits.test.js
diff options
context:
space:
mode:
authorMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:51:45 +0300
committerMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:51:45 +0300
commitd3261e64152397db2dca4d691a990c6bc2a6f4dd (patch)
treefac2f7be638651181a72453d714f0f96675c2b8b /archived/projt-launcher/ci/github-script/test/commits.test.js
parent31b9a8949ed0a288143e23bf739f2eb64fdc63be (diff)
downloadProject-Tick-d3261e64152397db2dca4d691a990c6bc2a6f4dd.tar.gz
Project-Tick-d3261e64152397db2dca4d691a990c6bc2a6f4dd.zip
NOISSUE add archived projects
Signed-off-by: Mehmet Samet Duman <yongdohyun@projecttick.org>
Diffstat (limited to 'archived/projt-launcher/ci/github-script/test/commits.test.js')
-rw-r--r--archived/projt-launcher/ci/github-script/test/commits.test.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/archived/projt-launcher/ci/github-script/test/commits.test.js b/archived/projt-launcher/ci/github-script/test/commits.test.js
new file mode 100644
index 0000000000..ed1be49682
--- /dev/null
+++ b/archived/projt-launcher/ci/github-script/test/commits.test.js
@@ -0,0 +1,42 @@
+#!/usr/bin/env node
+'use strict'
+
+process.env.COMMIT_TYPES = 'customtype'
+
+const assert = require('node:assert/strict')
+const commits = require('../commits.js')
+
+const { validateCommitMessage, normalizeCommitType } = commits
+
+const validMessages = [
+ 'feat(ui): add redesigned settings panel',
+ 'refactor: drop deprecated launcher flag support',
+ 'chore(ci): refresh workflows configuration',
+ '11.feat: support legacy numbered commit type format',
+ '23.deps(deps): bump dependency pins',
+ 'release: publish stable build artifacts',
+ 'customtype: allow env commit type overrides',
+]
+
+for (const message of validMessages) {
+ const result = validateCommitMessage(message)
+ assert.equal(
+ result.valid,
+ true,
+ `Expected commit "${message}" to be valid, got: ${result.message}`
+ )
+}
+
+const invalidType = validateCommitMessage('unknown(scope): add feature that is real enough')
+assert.equal(invalidType.valid, false, 'Expected invalid type to be rejected')
+assert.match(invalidType.message, /Unknown commit type/i)
+
+const shortDescription = validateCommitMessage('feat: short')
+assert.equal(shortDescription.valid, false, 'Expected short description to fail validation')
+assert.match(shortDescription.message, /too short/i)
+
+assert.equal(normalizeCommitType('11.feat'), 'feat')
+assert.equal(normalizeCommitType('23.deps'), 'deps')
+assert.equal(normalizeCommitType('chore'), 'chore')
+
+console.log('commits.js tests passed')