Skip to content

Commit c5ca30a

Browse files
committed
chore(*): make extra custom reporter optional on re-runs
1 parent 23ef78f commit c5ca30a

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

projects/igniteui-angular/src/lib/test-utils/configure-suite.ts

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,26 @@ export const configureTestSuite = (configureAction?: () => TestBed) => {
5252
});
5353
};
5454

55-
const myReporter = {
56-
suiteStarted: function(result) {
57-
const id = new URLSearchParams(window.parent.location.search).get('id');
58-
console.log(`[${id}] Suite started: ${result.fullName}`);
59-
60-
},
61-
62-
suiteDone: function(result) {
63-
const id = new URLSearchParams(window.parent.location.search).get('id');
64-
console.log(`[${id}] Suite: ${result.fullName} has ${result.status}`);
65-
for (const expectation of result.failedExpectations) {
66-
console.log('Suite ' + expectation.message);
67-
console.log(expectation.stack);
68-
}
69-
var memory = (performance as any).memory;
70-
console.log(`[${id}] totalJSHeapSize: ${memory['totalJSHeapSize']} usedJSHeapSize: ${memory['usedJSHeapSize']} jsHeapSizeLimit: ${memory['jsHeapSizeLimit']}`);
71-
if (memory['totalJSHeapSize'] >= memory['jsHeapSizeLimit'] )
72-
console.log( '--------------------Heap Size limit reached!!!-------------------');
73-
},
74-
};
75-
jasmine.getEnv().addReporter(myReporter);
55+
// should be accessible on re-run by selecting enable debug logging
56+
// https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging
57+
if (process.env.ACTIONS_RUNNER_DEBUG) {
58+
const myReporter = {
59+
suiteStarted: function(result) {
60+
const id = new URLSearchParams(window.parent.location.search).get('id');
61+
console.log(`[${id}] Suite started: ${result.fullName}`);
62+
},
63+
suiteDone: function(result) {
64+
const id = new URLSearchParams(window.parent.location.search).get('id');
65+
console.log(`[${id}] Suite: ${result.fullName} has ${result.status}`);
66+
for (const expectation of result.failedExpectations) {
67+
console.log('Suite ' + expectation.message);
68+
console.log(expectation.stack);
69+
}
70+
var memory = (performance as any).memory;
71+
console.log(`[${id}] totalJSHeapSize: ${memory['totalJSHeapSize']} usedJSHeapSize: ${memory['usedJSHeapSize']} jsHeapSizeLimit: ${memory['jsHeapSizeLimit']}`);
72+
if (memory['totalJSHeapSize'] >= memory['jsHeapSizeLimit'] )
73+
console.log( '--------------------Heap Size limit reached!!!-------------------');
74+
},
75+
};
76+
jasmine.getEnv().addReporter(myReporter);
77+
}

0 commit comments

Comments
 (0)