MCPcopy
hub / github.com/mongodb/node-mongodb-native / checkFlakyTestList

Function checkFlakyTestList

test/tools/runner/hooks/configuration.ts:201–222  ·  view source on GitHub ↗
(this: Context)

Source from the content-addressed store, hash-verified

199}
200
201function checkFlakyTestList(this: Context) {
202 const allTests: string[] = [];
203
204 const stack = [this.test.parent];
205 while (stack.length) {
206 const suite = stack.pop();
207 allTests.push(...suite.tests.map(test => test.fullTitle()));
208 stack.push(...suite.suites);
209 }
210 allTests.reverse(); // Doesn't matter but when debugging easier to see this in the expected order.
211
212 const flakyTestDoesNotExist = flakyTests.find(testName => !allTests.includes(testName));
213 if (flakyTestDoesNotExist != null) {
214 console.error(
215 '\n' + '='.repeat(100) + '\n',
216 'Flaky test:',
217 JSON.stringify(flakyTestDoesNotExist),
218 'is not run at all',
219 '\n' + '='.repeat(100) + '\n'
220 );
221 }
222}
223
224export const mochaHooks = {
225 beforeAll: [beforeAllPluginImports, testConfigBeforeHook, checkFlakyTestList],

Callers

nothing calls this directly

Calls 5

popMethod · 0.80
errorMethod · 0.80
pushMethod · 0.45
mapMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected