Skip to content

Commit b855100

Browse files
committed
merge main
2 parents 3fe31aa + 7d3403b commit b855100

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name": "pythagora",
3-
"version": "0.0.52",
3+
"version": "0.0.55",
44
"author": {
55
"name": "Zvonimir Sabljic",
6-
"email": "hi@pythagora.io"
6+
"email": "hi@pythagora.ai"
77
},
88
"license": "ISC",
99
"description": "Generate integration tests by recording server activity without writing a single line of code.",
1010
"repository": {
1111
"type": "git",
1212
"url": "https://github.com/Pythagora-io/pythagora"
1313
},
14-
"homepage": "https://pythagora.io/",
14+
"homepage": "https://pythagora.ai/",
1515
"main": "src/Pythagora.js",
1616
"scripts": {
1717
"publish-pythagora": "src/bin/publish.bash",
@@ -38,11 +38,11 @@
3838
"contributors": [
3939
{
4040
"name": "Zvonimir Sabljic",
41-
"email": "hi@pythagora.io"
41+
"email": "hi@pythagora.ai"
4242
},
4343
{
4444
"name": "Leon Ostrez",
45-
"email": "hi@pythagora.io"
45+
"email": "hi@pythagora.ai"
4646
}
4747
],
4848
"keywords": [

src/Pythagora.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Pythagora {
4040
this.idSeq = 0;
4141
this.requests = {};
4242
this.testingRequests = {};
43-
this.loggingEnabled = this.mode === 'capture';
43+
this.loggingEnabled = this.mode === MODES.capture;
4444
//todo move all global vars to tempVars
4545
this.tempVars = {};
4646

src/helpers/redis.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const MODES = require('../const/modes.json');
12
let net = require('net');
23

34
const CHUNK_SIZE = 1024;
@@ -15,7 +16,7 @@ module.exports = class RedisInterceptor {
1516
this.listenSocket = net.createServer(connection => {
1617
connection.on('data', data => {
1718

18-
if (this.mode === 'capture') {
19+
if (this.mode === MODES.capture) {
1920
this.forwardData(connection, data, true);
2021
} else if (this.mode === 'test') {
2122

src/utils/argumentsCheck.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
const AVAILABLE_MODES = Object.keys(require('../const/modes.json'));
1+
const MODES = require('../const/modes.json');
22
const args = require('./getArgs.js');
33
const { logAndExit } = require('./cmdPrint.js');
44

5+
const AVAILABLE_MODES = Object.keys(MODES);
6+
57
if (!args.mode) {
68
if (args.rerun_all_failed || args.test_id) {
79
console.log('Mode not provided. Setting to "test".');
810
args.mode = 'test';
911
} 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;
1214
}
1315
} else if (!AVAILABLE_MODES.includes(args.mode)) {
1416
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_
1820
if (args.test_id && !(args.mode === 'test' || args.mode === 'jest')) logAndExit(`Flag --test-id allowed only in "--mode test"`);
1921
if (args.rerun_all_failed && args.test_id) logAndExit(`Not allowed to set flags --rerun_all_failed and --test-id at same time.`);
2022

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}"`);
2325

2426
console.log(`Running "${process.env.PYTHAGORA_CONFIG}" using Pythagora in "${args.mode.toUpperCase()}" mode.`);
2527

0 commit comments

Comments
 (0)