mattermost-mobile-upstream/detox/utils/cli-args.js
yasser khan 6672333238
ci(e2e): port E2E CI stack to release-2.42 to unblock merges (#10005)
* ci(e2e): port E2E CI stack to release-2.42 to unblock merges

Combined backport of the main E2E CI surface through #9975 (Maestro,
CMT multi-platform, TSIO reporting, five-server Matterwick inputs, and
E2E/Override waive) so release-2.42 PRs can satisfy required e2e-test/*
checks via E2E/Run or E2E/Override.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci(test): exclude detox/ from root Jest (from #9925)

Root Jest was collecting detox/utils node:test suites brought in by the
E2E CI port, which fail with "must contain at least one test". Match main
by ignoring /detox/ in the app unit-test run.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 16:50:48 +05:30

35 lines
918 B
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
/**
* Minimal `--key value` / `--key=value` argv parser for CI utility scripts.
*
* @param {string[]} argv
* @returns {Record<string, string>}
*/
function parseArgs(argv) {
const out = {};
for (let i = 2; i < argv.length; i++) {
let key = argv[i];
if (!key.startsWith('--')) {
continue;
}
key = key.slice(2);
if (key.includes('=')) {
const idx = key.indexOf('=');
out[key.slice(0, idx)] = key.slice(idx + 1);
} else {
const next = argv[i + 1];
if (next === undefined || next.startsWith('--')) {
out[key] = 'true';
} else {
out[key] = next;
i++;
}
}
}
return out;
}
module.exports = {parseArgs};