mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-15 12:45:29 +02:00
Merge remote-tracking branch 'origin/pr-3523' into steward/late-arrivals-20261011
This commit is contained in:
@@ -93,6 +93,28 @@ async function runTests() {
|
||||
let passed = 0;
|
||||
let failed = 0;
|
||||
|
||||
if (
|
||||
await test('rejects malformed issue numbers during argument parsing', async () => {
|
||||
const { parseArgs } = require(SCRIPT);
|
||||
|
||||
for (const argv of [
|
||||
['node', 'github-coordination.js', 'claim', '42oops', '--repo', 'example/project'],
|
||||
['node', 'github-coordination.js', 'claim', '--issue', '42.9', '--repo', 'example/project'],
|
||||
['node', 'github-coordination.js', 'claim', '--issue', '4e2', '--repo', 'example/project'],
|
||||
['node', 'github-coordination.js', 'claim', '--issue', '9007199254740993', '--repo', 'example/project'],
|
||||
['node', 'github-coordination.js', 'claim', '--limit', '42.9', '--repo', 'example/project'],
|
||||
]) {
|
||||
assert.throws(() => parseArgs(argv), /Invalid issue number/);
|
||||
}
|
||||
|
||||
const valid = parseArgs(['node', 'github-coordination.js', 'claim', '7', '--repo', 'example/project']);
|
||||
assert.strictEqual(valid.issueNumber, 7);
|
||||
assert.strictEqual(valid.limit, 100);
|
||||
})
|
||||
)
|
||||
passed++;
|
||||
else failed++;
|
||||
|
||||
if (
|
||||
await test('claims an epic issue, updates GitHub state, and caches a work item', async () => {
|
||||
const rootDir = createTempDir('github-coordination-claim-');
|
||||
|
||||
Reference in New Issue
Block a user