File tree 3 files changed +15
-4
lines changed 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ module.exports = {
46
46
},
47
47
*/
48
48
49
+ // Integration test transaction logging
50
+ integrationTestLog: {
51
+ outputFolder: 'tmp/', // Should match .github/workflows/integration-test.yml -> upload-artifact
52
+ },
53
+
49
54
// Optional config so you can set the token you want to use in this wallet
50
55
// If this parameter is set you don't need to pass your token when getting balance or sending tokens
51
56
tokenUid: '',
Original file line number Diff line number Diff line change @@ -40,20 +40,26 @@ export class TxLogger {
40
40
*/
41
41
constructor ( title ) {
42
42
const date = new Date ( ) ;
43
+
44
+ /**
45
+ * Timestamp in a format like "20220224T084737" for easy human reading on a filename
46
+ * @type {string }
47
+ */
43
48
const humanReadableTimestamp = date . toISOString ( )
44
49
. replace ( / - / g, '' ) // Remove date separator
45
50
. replace ( / : / g, '' ) // Remove hour separator
46
51
. split ( '.' ) [ 0 ] ; // Get only the seconds integer
52
+
47
53
const additionalTitle = title ? `-${ title } ` : '' ;
48
54
const filename = `${ humanReadableTimestamp } ${ additionalTitle } -integrationTest.log` ;
49
55
this . #instanceFilename = filename ;
50
56
}
51
57
52
58
/**
53
59
* Initializes the helper with a winston logger instance
54
- * @returns {Promise< void> }
60
+ * @returns {void }
55
61
*/
56
- async init ( ) {
62
+ init ( ) {
57
63
this . #logger = winston . createLogger ( {
58
64
defaultMeta : { service : 'txLogger' } ,
59
65
transports : [
@@ -69,7 +75,7 @@ export class TxLogger {
69
75
winston . format . timestamp ( ) ,
70
76
winston . format . prettyPrint ( )
71
77
) ,
72
- filename : `tmp/ ${ this . #instanceFilename} ` ,
78
+ filename : `${ config . integrationTestLog . outputFolder } ${ this . #instanceFilename} ` ,
73
79
level : config . consoleLevel || 'silly' ,
74
80
colorize : false ,
75
81
} )
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ beforeAll(async () => {
19
19
// Initializing the Transaction Logger with the test name
20
20
const testName = getTestNameFromGlobalJasmineInstance ( ) ;
21
21
const testLogger = new TxLogger ( testName ) ;
22
- await testLogger . init ( __dirname ) ;
22
+ testLogger . init ( ) ;
23
23
loggers . test = testLogger ;
24
24
25
25
await TestUtils . startWallet ( WALLET_CONSTANTS . genesis ) ;
You can’t perform that action at this time.
0 commit comments