File tree Expand file tree Collapse file tree 4 files changed +15
-12
lines changed Expand file tree Collapse file tree 4 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " pythagora" ,
3
- "version" : " 0.0.52 " ,
3
+ "version" : " 0.0.55 " ,
4
4
"author" : {
5
5
"name" : " Zvonimir Sabljic" ,
6
- "email" : " hi@pythagora.io "
6
+ "email" : " hi@pythagora.ai "
7
7
},
8
8
"license" : " ISC" ,
9
9
"description" : " Generate integration tests by recording server activity without writing a single line of code." ,
10
10
"repository" : {
11
11
"type" : " git" ,
12
12
"url" : " https://github.com/Pythagora-io/pythagora"
13
13
},
14
- "homepage" : " https://pythagora.io /" ,
14
+ "homepage" : " https://pythagora.ai /" ,
15
15
"main" : " src/Pythagora.js" ,
16
16
"scripts" : {
17
17
"publish-pythagora" : " src/bin/publish.bash" ,
38
38
"contributors" : [
39
39
{
40
40
"name" : " Zvonimir Sabljic" ,
41
- "email" : " hi@pythagora.io "
41
+ "email" : " hi@pythagora.ai "
42
42
},
43
43
{
44
44
"name" : " Leon Ostrez" ,
45
- "email" : " hi@pythagora.io "
45
+ "email" : " hi@pythagora.ai "
46
46
}
47
47
],
48
48
"keywords" : [
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class Pythagora {
40
40
this . idSeq = 0 ;
41
41
this . requests = { } ;
42
42
this . testingRequests = { } ;
43
- this . loggingEnabled = this . mode === ' capture' ;
43
+ this . loggingEnabled = this . mode === MODES . capture ;
44
44
//todo move all global vars to tempVars
45
45
this . tempVars = { } ;
46
46
Original file line number Diff line number Diff line change
1
+ const MODES = require ( '../const/modes.json' ) ;
1
2
let net = require ( 'net' ) ;
2
3
3
4
const CHUNK_SIZE = 1024 ;
@@ -15,7 +16,7 @@ module.exports = class RedisInterceptor {
15
16
this . listenSocket = net . createServer ( connection => {
16
17
connection . on ( 'data' , data => {
17
18
18
- if ( this . mode === ' capture' ) {
19
+ if ( this . mode === MODES . capture ) {
19
20
this . forwardData ( connection , data , true ) ;
20
21
} else if ( this . mode === 'test' ) {
21
22
Original file line number Diff line number Diff line change 1
- const AVAILABLE_MODES = Object . keys ( require ( '../const/modes.json' ) ) ;
1
+ const MODES = require ( '../const/modes.json' ) ;
2
2
const args = require ( './getArgs.js' ) ;
3
3
const { logAndExit } = require ( './cmdPrint.js' ) ;
4
4
5
+ const AVAILABLE_MODES = Object . keys ( MODES ) ;
6
+
5
7
if ( ! args . mode ) {
6
8
if ( args . rerun_all_failed || args . test_id ) {
7
9
console . log ( 'Mode not provided. Setting to "test".' ) ;
8
10
args . mode = 'test' ;
9
11
} else {
10
- console . log ( ' Mode not provided. Defaulting to "capture".' ) ;
11
- args . mode = ' capture' ;
12
+ console . log ( ` Mode not provided. Defaulting to "${ MODES . capture } ".` ) ;
13
+ args . mode = MODES . capture ;
12
14
}
13
15
} else if ( ! AVAILABLE_MODES . includes ( args . mode ) ) {
14
16
logAndExit ( `Mode "${ args . mode } " not recognized. Available modes are: ${ AVAILABLE_MODES . join ( ', ' ) } ` ) ;
@@ -18,8 +20,8 @@ if (args.rerun_all_failed && args.mode !== 'test') logAndExit(`Flag --rerun_all_
18
20
if ( args . test_id && ! ( args . mode === 'test' || args . mode === 'jest' ) ) logAndExit ( `Flag --test-id allowed only in "--mode test"` ) ;
19
21
if ( args . rerun_all_failed && args . test_id ) logAndExit ( `Not allowed to set flags --rerun_all_failed and --test-id at same time.` ) ;
20
22
21
- if ( args . pick && args . mode !== ' capture' ) logAndExit ( `Flag --pick allowed only in "--mode capture"` ) ;
22
- if ( args . ignore && args . mode !== ' capture' ) logAndExit ( `Flag --ignore allowed only in "--mode capture"` ) ;
23
+ if ( args . pick && args . mode !== MODES . capture ) logAndExit ( `Flag --pick allowed only in "--mode ${ MODES . capture } "` ) ;
24
+ if ( args . ignore && args . mode !== MODES . capture ) logAndExit ( `Flag --ignore allowed only in "--mode ${ MODES . capture } "` ) ;
23
25
24
26
console . log ( `Running "${ process . env . PYTHAGORA_CONFIG } " using Pythagora in "${ args . mode . toUpperCase ( ) } " mode.` ) ;
25
27
You can’t perform that action at this time.
0 commit comments