Skip to content

Commit a7e1e91

Browse files
PR review
1 parent 311fe41 commit a7e1e91

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

packages/datadog-instrumentations/src/playwright.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,23 +1262,24 @@ addHook({
12621262

12631263
function generateSummaryWrapper (generateSummary) {
12641264
return function () {
1265-
// https://github.com/microsoft/playwright/blob/bf92ffecff6f30a292b53430dbaee0207e0c61ad/packages/playwright/src/reporters/base.ts#L279
1266-
const didNotRunTests = this.suite.allTests().filter(test =>
1267-
test.outcome() === 'skipped' && (!test.results.length || test.expectedStatus !== 'skipped')
1268-
)
1269-
for (const test of didNotRunTests) {
1270-
const {
1271-
_requireFile: testSuiteAbsolutePath,
1272-
location: { line: testSourceLine },
1273-
} = test
1274-
const browserName = getBrowserNameFromProjects(sessionProjects, test)
1275-
1276-
testSkipCh.publish({
1277-
testName: getTestFullname(test),
1278-
testSuiteAbsolutePath,
1279-
testSourceLine,
1280-
browserName,
1281-
})
1265+
for (const test of this.suite.allTests()) {
1266+
// https://github.com/microsoft/playwright/blob/bf92ffecff6f30a292b53430dbaee0207e0c61ad/packages/playwright/src/reporters/base.ts#L279
1267+
const didNotRun = test.outcome() === 'skipped' &&
1268+
(!test.results.length || test.expectedStatus !== 'skipped')
1269+
if (didNotRun) {
1270+
const {
1271+
_requireFile: testSuiteAbsolutePath,
1272+
location: { line: testSourceLine },
1273+
} = test
1274+
const browserName = getBrowserNameFromProjects(sessionProjects, test)
1275+
1276+
testSkipCh.publish({
1277+
testName: getTestFullname(test),
1278+
testSuiteAbsolutePath,
1279+
testSourceLine,
1280+
browserName,
1281+
})
1282+
}
12821283
}
12831284
return generateSummary.apply(this, arguments)
12841285
}
@@ -1296,8 +1297,7 @@ addHook({
12961297
// v1.50.0 changed the name of the base reporter from BaseReporter to TerminalReporter
12971298
if (reportersPackage.TerminalReporter) {
12981299
shimmer.wrap(reportersPackage.TerminalReporter.prototype, 'generateSummary', generateSummaryWrapper)
1299-
}
1300-
if (reportersPackage.BaseReporter) {
1300+
} else if (reportersPackage.BaseReporter) {
13011301
shimmer.wrap(reportersPackage.BaseReporter.prototype, 'generateSummary', generateSummaryWrapper)
13021302
}
13031303
return reportersPackage

0 commit comments

Comments
 (0)