Skip to content

Commit 43f78e2

Browse files
committed
fixes for exporting tests to jest
1 parent aebc5f5 commit 43f78e2

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pythagora",
3-
"version": "0.0.58",
3+
"version": "0.0.59",
44
"author": {
55
"name": "Zvonimir Sabljic",
66
"email": "[email protected]"

src/helpers/api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,18 @@ async function getJestTest(test) {
100100
return await makeRequest(JSON.stringify(test), options);
101101
}
102102

103-
async function getJestTestName(jestTest, usedNames) {
103+
async function getJestTestName(test, usedNames) {
104104
let options = setOptions({path:'/api/generate-jest-test-name'});
105-
return await makeRequest(JSON.stringify({test: jestTest}), options);
105+
return await makeRequest(JSON.stringify({ test }), options);
106106
}
107107

108-
async function isEligibleForExport(jestTest) {
108+
async function isEligibleForExport(test) {
109109
try {
110110
let options = setOptions({ path: '/api/check-if-eligible' });
111111

112112
const response = await axios.post(
113113
`${options.protocol}://${options.hostname}${options.port ? ':' + options.port : ''}${options.path}`,
114-
JSON.stringify({ jestTest }),
114+
JSON.stringify({ test }),
115115
{ headers: options.headers }
116116
);
117117

src/scripts/enterData.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const {loginRouteEnteredLog} = require("../utils/cmdPrint");
22
const {updateMetadata} = require("../utils/common");
3+
const {setUpPythagoraDirs} = require("../helpers/starting");
34
const {METADATA_FILENAME, SRC_TO_ROOT} = require("../const/common");
45
// TODO make require path better!!
5-
let pythagoraMetadata = require(`../${SRC_TO_ROOT}.pythagora/${METADATA_FILENAME}`);
66
const readline = require("readline");
77
const _ = require("lodash");
88

99

1010
function askForLoginRoute(rl) {
11-
rl.question('Please enter the endpoint path of the login route (eg. /api/auth/login): ', loginPath => {
11+
rl.question('\x1b[32m Please enter the endpoint path of the login route (eg. /api/auth/login): \x1b[0m', loginPath => {
1212
loginRouteEnteredLog(loginPath);
1313

1414
rl.question('Is this correct login endpoint path (Y/N): ', answer => {
@@ -35,4 +35,6 @@ function addExportData() {
3535
}, 500);
3636
}
3737

38+
setUpPythagoraDirs();
39+
let pythagoraMetadata = require(`../${SRC_TO_ROOT}.pythagora/${METADATA_FILENAME}`);
3840
addExportData();

0 commit comments

Comments
 (0)