MCPcopy
hub / github.com/remix-run/remix / executeRun

Function executeRun

packages/test/src/cli.ts:149–343  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147 }
148
149 let executeRun = async () => {
150 if (hasExited) return
151
152 running = true
153
154 let globalTeardown: (() => Promise<void> | void) | undefined
155
156 try {
157 if (config.setup) {
158 let mod = await importModule(path.resolve(cwd, config.setup), import.meta)
159 let globalSetup: (() => Promise<void> | void) | undefined = mod.globalSetup
160 globalTeardown = mod.globalTeardown
161 await globalSetup?.()
162 }
163
164 let discoveredTests = await discoverTests(config, cwd)
165 if (discoveredTests == null) {
166 latestExitCode = 1
167 cleanupAndExit(latestExitCode)
168 return
169 }
170
171 let { files, serverFiles, browserFiles, e2eFiles } = discoveredTests
172
173 if (config.watch) {
174 watcher ??= createWatcher((file) => queueRerun(file))
175 watcher.update(files)
176 }
177
178 let browserFilesKey = browserFiles.join('\0')
179 if (browserServer && browserFiles.length === 0) {
180 await closeBrowserServer()
181 } else if (
182 browserFiles.length > 0 &&
183 (!browserServer || browserServerFilesKey !== browserFilesKey)
184 ) {
185 await closeBrowserServer()
186 let { startServer } = IS_RUNNING_FROM_SRC
187 ? await importModule('./app/server.ts', import.meta)
188 : await import(`./app/server.js`)
189 let result = await startServer(browserFiles)
190 browserServer = result.server
191 browserServerFilesKey = browserFilesKey
192 browserBaseUrl = result.baseUrl
193 }
194
195 let reporter = createReporter(config.reporter)
196 let startTime = performance.now()
197
198 let counts: Counts = {
199 passed: 0,
200 failed: 0,
201 skipped: 0,
202 todo: 0,
203 }
204 let allCoverageMaps: Array<ReturnType<typeof Object.values>[number] | null | undefined> = []
205
206 if (serverFiles.length > 0) {

Callers 2

queueRerunFunction · 0.85
runRemixTestInCwdFunction · 0.85

Calls 15

importModuleFunction · 0.90
createWatcherFunction · 0.90
createReporterFunction · 0.90
runServerTestsFunction · 0.90
discoverTestsFunction · 0.85
cleanupAndExitFunction · 0.85
queueRerunFunction · 0.85
closeBrowserServerFunction · 0.85
importPlaywrightSupportFunction · 0.85
importBrowserTestRunnerFunction · 0.85
loadPlaywrightConfigFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…