Skip to content

Commit 3230565

Browse files
committed
Add some timestamps to the logs
1 parent 21f6c54 commit 3230565

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
function getTimestamp() {
2+
return (process.env.CI || process.env.VERBOSE)
3+
? new Date().toLocaleTimeString('en-US', { hour12: false })
4+
: '';
5+
}
6+
7+
function logStamp(...args) {
8+
console.log(getTimestamp(), ...args);
9+
}
10+
111
class CleanReporter {
212
onBegin(config, suite) {
313
console.log(`\n🎭 Running ${suite.allTests().length} tests...\n`);
@@ -15,9 +25,9 @@ class CleanReporter {
1525
.trim();
1626

1727
if (result.status === "passed") {
18-
console.log(`✅ ${cleanSuite}: ${testName}`);
28+
logStamp(`✅ ${cleanSuite}: ${testName}`);
1929
} else if (result.status === "failed") {
20-
console.log(`❌ ${cleanSuite}: ${testName}`);
30+
logStamp(`❌ ${cleanSuite}: ${testName}`);
2131

2232
// Extract the most relevant error info
2333
const error = result.error || result.errors?.[0];
@@ -60,15 +70,17 @@ class CleanReporter {
6070

6171
onEnd(result) {
6272
console.log("\n" + "=".repeat(60));
63-
console.log(`📊 TEST SUMMARY`);
73+
logStamp(`📊 TEST SUMMARY`);
6474
console.log("=".repeat(60));
6575

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

7385
console.log("=".repeat(60) + "\n");
7486
}

0 commit comments

Comments
 (0)