Skip to content

Commit 63f42c2

Browse files
Make TypeScript test reporter optional (#37182)
1 parent 7b13d42 commit 63f42c2

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

sdks/typescript/reporterConfig.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,19 @@
1010
// License for the specific language governing permissions and limitations under
1111
// the License.
1212

13-
const develocityReporter = require.resolve('@gradle-tech/develocity-agent/mocha-reporter');
13+
let develocityReporter = null;
14+
try {
15+
// Optional: used in ASF CI for build scans. Local contributors may not have it.
16+
develocityReporter = require.resolve(
17+
"@gradle-tech/develocity-agent/mocha-reporter",
18+
);
19+
} catch (e) {
20+
// Fall back to the default reporter when the Develocity reporter is not installed.
21+
develocityReporter = null;
22+
}
1423

1524
module.exports = {
16-
reporterEnabled: ['spec', develocityReporter].join(', '),
17-
}
25+
reporterEnabled: develocityReporter
26+
? ["spec", develocityReporter].join(", ")
27+
: "spec",
28+
};

0 commit comments

Comments
 (0)