Skip to content

Commit 831ba88

Browse files
committed
Add some timestamps to the logs
1 parent 94108b9 commit 831ba88

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

typescript-sdk/apps/dojo/e2e/clean-reporter.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
function getTimestamp() {
2+
(process.env.CI || process.env.VERBOSE) ? new Date().toISOString(): '';
3+
}
4+
5+
function logStamp(...args) {
6+
console.log(getTimestamp(), ...args);
7+
}
8+
19
class CleanReporter {
210
onBegin(config, suite) {
311
console.log(`\n🎭 Running ${suite.allTests().length} tests...\n`);
@@ -15,9 +23,9 @@ class CleanReporter {
1523
.trim();
1624

1725
if (result.status === "passed") {
18-
console.log(`${cleanSuite}: ${testName}`);
26+
logStamp(`${getTimestamp()}${cleanSuite}: ${testName}`);
1927
} else if (result.status === "failed") {
20-
console.log(`${cleanSuite}: ${testName}`);
28+
logStamp(`${getTimestamp()}${cleanSuite}: ${testName}`);
2129

2230
// Extract the most relevant error info
2331
const error = result.error || result.errors?.[0];
@@ -60,15 +68,17 @@ class CleanReporter {
6068

6169
onEnd(result) {
6270
console.log("\n" + "=".repeat(60));
63-
console.log(`📊 TEST SUMMARY`);
71+
logStamp(`📊 TEST SUMMARY`);
6472
console.log("=".repeat(60));
6573

6674
console.log(`\n🔍 FAILURE ANALYSIS:`);
6775
console.log(`• Most failures appear to be AI service related`);
6876
console.log(`• Check API keys and service availability`);
69-
console.log(
70-
`• Run 'pnpm exec playwright show-report' for detailed HTML report`
71-
);
77+
if (!process.env.CI) {
78+
console.log(
79+
`• Run 'pnpm exec playwright show-report' for detailed HTML report`
80+
);
81+
}
7282

7383
console.log("=".repeat(60) + "\n");
7484
}

0 commit comments

Comments
 (0)