File tree 6 files changed +26
-24
lines changed 6 files changed +26
-24
lines changed Original file line number Diff line number Diff line change @@ -46,14 +46,6 @@ module.exports = {
46
46
},
47
47
*/
48
48
49
- // Integration test configs
50
- integrationTest: {
51
- logOutputFolder: 'tmp/', // Should match .github/workflows/integration-test.yml -> upload-artifact
52
- consoleLevel: 'silly',
53
- wsUpdateDelay: 1000,
54
- walletStartTimeout: 60000,
55
- },
56
-
57
49
// Optional config so you can set the token you want to use in this wallet
58
50
// If this parameter is set you don't need to pass your token when getting balance or sending tokens
59
51
tokenUid: '',
Original file line number Diff line number Diff line change
1
+ /*
2
+ * This file contains the configurations specific for the integration tests on the Wallet Headless.
3
+ * Those values are also editable via envrionment variables
4
+ */
5
+
6
+ module . exports = {
7
+ // On CI, should match .github/workflows/integration-test.yml -> upload-artifact
8
+ logOutputFolder : process . env . TEST_LOG_OUTPUT_FOLDER || 'tmp/' ,
9
+
10
+ // Console level used on winston
11
+ consoleLevel : process . env . TEST_CONSOLE_LEVEL || 'silly' ,
12
+
13
+ // Defines how long tests should wait before consulting balances after transactions
14
+ wsUpdateDelay : process . env . TEST_WS_UPDATE_DELAY || 1000 ,
15
+
16
+ // Defines for how long the startMultipleWalletsForTest can run
17
+ walletStartTimeout : process . env . TEST_WALLET_START_TIMEOUT || 60000 ,
18
+ } ;
Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-console */
2
2
3
3
import winston from 'winston' ;
4
- import config from '../../src/ config' ;
4
+ import testConfig from './configuration/test. config' ;
5
5
6
6
export const loggers = {
7
7
/**
@@ -68,15 +68,15 @@ export class TxLogger {
68
68
winston . format . timestamp ( ) ,
69
69
winston . format . colorize ( ) ,
70
70
) ,
71
- level : config . integrationTest . consoleLevel || 'silly' ,
71
+ level : testConfig . consoleLevel || 'silly' ,
72
72
} ) ,
73
73
new winston . transports . File ( {
74
74
format : winston . format . combine (
75
75
winston . format . timestamp ( ) ,
76
76
winston . format . prettyPrint ( )
77
77
) ,
78
- filename : `${ config . integrationTest . logOutputFolder } ${ this . #instanceFilename} ` ,
79
- level : config . integrationTest . consoleLevel || 'silly' ,
78
+ filename : `${ testConfig . logOutputFolder } ${ this . #instanceFilename} ` ,
79
+ level : testConfig . consoleLevel || 'silly' ,
80
80
colorize : false ,
81
81
} )
82
82
]
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import supertest from 'supertest';
4
4
import { HathorWallet , wallet } from '@hathor/wallet-lib' ;
5
5
import app from '../../../src' ;
6
6
import { loggers } from '../txLogger' ;
7
- import config from '../../../src/ config' ;
7
+ import testConfig from '../configuration/test. config' ;
8
8
9
9
const request = supertest ( app ) ;
10
10
@@ -82,7 +82,7 @@ export class TestUtils {
82
82
* @returns {Promise<void> }
83
83
*/
84
84
static async pauseForWsUpdate ( ) {
85
- await TestUtils . delay ( config . integrationTest . wsUpdateDelay ) ;
85
+ await TestUtils . delay ( testConfig . wsUpdateDelay ) ;
86
86
}
87
87
88
88
/**
Original file line number Diff line number Diff line change 1
1
import { loggers } from '../txLogger' ;
2
2
import { TestUtils , WALLET_CONSTANTS } from './test-utils-integration' ;
3
- import config from '../../../src/ config' ;
3
+ import testConfig from '../configuration/test. config' ;
4
4
5
5
/**
6
6
* A helper for testing the wallet
@@ -96,7 +96,7 @@ export class WalletHelper {
96
96
97
97
// Enters the loop checking each wallet for its status
98
98
const timestampStart = Date . now ( ) . valueOf ( ) ;
99
- const timestampTimeout = timestampStart + config . integrationTest . walletStartTimeout ;
99
+ const timestampTimeout = timestampStart + testConfig . walletStartTimeout ;
100
100
while ( true ) {
101
101
const pendingWalletIds = Object . keys ( walletsPendingReady ) ;
102
102
// If all wallets were started, return to the caller.
Original file line number Diff line number Diff line change @@ -40,14 +40,6 @@ module.exports = {
40
40
},
41
41
*/
42
42
43
- // Integration test configs
44
- integrationTest: {
45
- logOutputFolder: 'tmp/', // Should match .github/workflows/integration-test.yml -> upload-artifact
46
- consoleLevel: 'silly',
47
- wsUpdateDelay: 1000,
48
- walletStartTimeout: 60000,
49
- },
50
-
51
43
// Optional config so you can set the token you want to use in this wallet
52
44
// If this parameter is set you don't need to pass your token when getting balance or sending tokens
53
45
tokenUid: '',
You can’t perform that action at this time.
0 commit comments