MCPcopy
hub / github.com/vercel/next.js / cleanUpAndExit

Function cleanUpAndExit

run-tests.js:171–194  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

169let exiting = false
170
171const cleanUpAndExit = async (code) => {
172 if (exiting) {
173 return
174 }
175 exiting = true
176 console.log(`exiting with code ${code}`)
177
178 if (process.env.NEXT_TEST_STARTER) {
179 await fsp.rm(process.env.NEXT_TEST_STARTER, {
180 recursive: true,
181 force: true,
182 })
183 }
184 if (process.env.NEXT_TEST_TEMP_REPO) {
185 await fsp.rm(process.env.NEXT_TEST_TEMP_REPO, {
186 recursive: true,
187 force: true,
188 })
189 }
190 if (process.env.CI) {
191 await maybeLogSummary()
192 }
193 process.exit(code)
194}
195
196const isMatchingPattern = (pattern, file) => {
197 if (pattern instanceof RegExp) {

Callers 2

mainFunction · 0.85
run-tests.jsFile · 0.85

Calls 3

maybeLogSummaryFunction · 0.85
logMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected