MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / run

Function run

dev-packages/e2e-tests/run.ts:118–249  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116}
117
118async function run(): Promise<void> {
119 // Load environment variables from .env file locally
120 dotenv.config();
121
122 // Allow to run a single app only via `yarn test:run <app-name>`
123 const appName = process.argv[2] || '';
124 // Forward any additional flags to the test command
125 const allTestFlags = process.argv.slice(3);
126
127 // Check for --variant flag
128 let variantLabel: string | undefined;
129 let skipNextFlag = false;
130
131 const testFlags = allTestFlags.filter((flag, index) => {
132 // Skip this flag if it was marked to skip (variant value after --variant)
133 if (skipNextFlag) {
134 skipNextFlag = false;
135 return false;
136 }
137
138 // Handle --variant=<value> format
139 if (flag.startsWith('--variant=')) {
140 const value = flag.slice('--variant='.length);
141 const trimmedValue = value?.trim();
142 if (trimmedValue) {
143 variantLabel = trimmedValue;
144 } else {
145 console.warn('Warning: --variant= specified but no value provided. Ignoring variant flag.');
146 }
147 return false; // Remove this flag from testFlags
148 }
149
150 // Handle --variant <value> format
151 if (flag === '--variant') {
152 if (index + 1 < allTestFlags.length) {
153 const value = allTestFlags[index + 1];
154 const trimmedValue = value?.trim();
155 if (trimmedValue) {
156 variantLabel = trimmedValue;
157 skipNextFlag = true; // Mark next flag to be skipped
158 } else {
159 console.warn('Warning: --variant specified but no value provided. Ignoring variant flag.');
160 }
161 } else {
162 console.warn('Warning: --variant specified but no value provided. Ignoring variant flag.');
163 }
164 return false;
165 }
166
167 return true;
168 });
169
170 const dsn = process.env.E2E_TEST_DSN || DEFAULT_DSN;
171
172 const envVarsToInject = {
173 E2E_TEST_DSN: dsn,
174 NEXT_PUBLIC_E2E_TEST_DSN: dsn,
175 PUBLIC_E2E_TEST_DSN: dsn,

Callers 1

run.tsFile · 0.70

Calls 11

resolveFunction · 0.90
joinFunction · 0.90
copyToTempFunction · 0.90
addPnpmOverridesFunction · 0.90
asyncExecFunction · 0.85
getVariantBuildCommandFunction · 0.85
sliceMethod · 0.80
replaceMethod · 0.80
warnMethod · 0.65
logMethod · 0.65

Tested by

no test coverage detected