MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / parseSelectors

Function parseSelectors

src/utils/test-preflight.ts:65–98  ·  view source on GitHub ↗
(
  extraArgs: string[] | undefined,
  flagName: '-only-testing' | '-skip-testing',
)

Source from the content-addressed store, hash-verified

63}
64
65function parseSelectors(
66 extraArgs: string[] | undefined,
67 flagName: '-only-testing' | '-skip-testing',
68): TestSelector[] {
69 if (!extraArgs) {
70 return [];
71 }
72
73 const selectors: TestSelector[] = [];
74
75 for (let index = 0; index < extraArgs.length; index += 1) {
76 const argument = extraArgs[index];
77 if (argument === flagName) {
78 const nextValue = extraArgs[index + 1];
79 if (nextValue) {
80 const selector = parseSelector(nextValue);
81 if (selector) {
82 selectors.push(selector);
83 }
84 index += 1;
85 }
86 continue;
87 }
88
89 if (argument.startsWith(`${flagName}:`)) {
90 const selector = parseSelector(argument.slice(flagName.length + 1));
91 if (selector) {
92 selectors.push(selector);
93 }
94 }
95 }
96
97 return selectors;
98}
99
100function extractAttributeValue(tagBody: string, attributeName: string): string | undefined {
101 const match = tagBody.match(new RegExp(`${attributeName}\\s*=\\s*"([^"]+)"`));

Callers 1

resolveTestPreflightFunction · 0.85

Calls 2

parseSelectorFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected