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

Function maybeLogSummary

run-tests.js:124–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122const errorsPerTests = new Map()
123
124async function maybeLogSummary() {
125 if (process.env.CI && errorsPerTests.size > 0) {
126 const outputTemplate = `
127${Array.from(errorsPerTests.entries())
128 .map(([test, { output }]) => {
129 return `
130<details>
131<summary>${test}</summary>
132
133\`\`\`
134${output}
135\`\`\`
136
137</details>
138`
139 })
140 .join('\n')}`
141
142 // Build table rows with one row per failed test case
143 const tableRows = []
144 for (const [test, { failedCases }] of errorsPerTests.entries()) {
145 const testLink = `<a href="https://github.com/vercel/next.js/blob/canary/${test}">${test}</a>`
146 if (failedCases.length === 0) {
147 tableRows.push(['Unknown', testLink])
148 } else {
149 for (const caseName of failedCases) {
150 tableRows.push([caseName, testLink])
151 }
152 }
153 }
154
155 await core.summary
156 .addHeading('Tests failures')
157 .addTable([
158 [
159 { data: 'Test Name', header: true },
160 { data: 'Test Path', header: true },
161 ],
162 ...tableRows,
163 ])
164 .addRaw(outputTemplate)
165 .write()
166 }
167}
168
169let exiting = false
170

Callers 1

cleanUpAndExitFunction · 0.85

Calls 6

pushMethod · 0.65
joinMethod · 0.45
mapMethod · 0.45
fromMethod · 0.45
entriesMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected