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

Function collectTests

etc/crawfish.mjs:124–149  ·  etc/crawfish.mjs::collectTests
(xuint, testFilter)

Source from the content-addressed store, hash-verified

122}
123
124function collectTests(xuint, testFilter) {
125 const suites = xuint.testsuites.testsuite;
126
127 const tests = [];
128
129 for (const suite of suites) {
130 if (suite.testcase) {
131 for (const test of suite.testcase) {
132 const fullName = `${suite.$.name} ${test.$.name}`;
133 if (fullName.toLowerCase().includes(testFilter.toLowerCase())) {
134 if (test.$.start === class="st">'0') {
135 if (warnings) console.error(`Warning: ${fullName} was skipped, theres no logs`);
136 continue;
137 }
138 tests.push({
139 name: fullName,
140 start: Date.parse(test.$.start),
141 end: Date.parse(test.$.end)
142 });
143 }
144 }
145 }
146 }
147
148 return tests;
149}
150
151main(process.argv).catch(e => {
152 console.error(e);

Callers 1

mainFunction · 0.70

Calls 3

errorMethod · 0.80
pushMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected