@xano/cli 0.0.35 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/unit_test/run_all/index.js +11 -12
- package/dist/commands/workflow_test/run_all/index.js +10 -11
- package/oclif.manifest.json +2083 -2083
- package/package.json +1 -1
|
@@ -76,8 +76,8 @@ Results: 2 passed, 1 failed
|
|
|
76
76
|
}
|
|
77
77
|
const listResponse = await this.verboseFetch(`${baseUrl}?${listParams}`, {
|
|
78
78
|
headers: {
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
accept: 'application/json',
|
|
80
|
+
Authorization: `Bearer ${profile.access_token}`,
|
|
81
81
|
},
|
|
82
82
|
method: 'GET',
|
|
83
83
|
}, flags.verbose, profile.access_token);
|
|
@@ -85,7 +85,7 @@ Results: 2 passed, 1 failed
|
|
|
85
85
|
const errorText = await listResponse.text();
|
|
86
86
|
this.error(`Failed to list unit tests: ${listResponse.status}: ${listResponse.statusText}\n${errorText}`);
|
|
87
87
|
}
|
|
88
|
-
const data = await listResponse.json();
|
|
88
|
+
const data = (await listResponse.json());
|
|
89
89
|
let tests;
|
|
90
90
|
if (Array.isArray(data)) {
|
|
91
91
|
tests = data;
|
|
@@ -110,8 +110,8 @@ Results: 2 passed, 1 failed
|
|
|
110
110
|
try {
|
|
111
111
|
const runResponse = await this.verboseFetch(runUrl, {
|
|
112
112
|
headers: {
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
accept: 'application/json',
|
|
114
|
+
Authorization: `Bearer ${profile.access_token}`,
|
|
115
115
|
'Content-Type': 'application/json',
|
|
116
116
|
},
|
|
117
117
|
method: 'POST',
|
|
@@ -132,9 +132,9 @@ Results: 2 passed, 1 failed
|
|
|
132
132
|
}
|
|
133
133
|
continue;
|
|
134
134
|
}
|
|
135
|
-
const runResult = await runResponse.json();
|
|
135
|
+
const runResult = (await runResponse.json());
|
|
136
136
|
const passed = runResult.status === 'ok';
|
|
137
|
-
const failedExpects = runResult.results?.filter(r => r.status === 'fail') ?? [];
|
|
137
|
+
const failedExpects = runResult.results?.filter((r) => r.status === 'fail') ?? [];
|
|
138
138
|
const result = {
|
|
139
139
|
message: failedExpects[0]?.message,
|
|
140
140
|
name: test.name,
|
|
@@ -173,8 +173,8 @@ Results: 2 passed, 1 failed
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
// Step 3: Summary
|
|
176
|
-
const passed = results.filter(r => r.status === 'pass').length;
|
|
177
|
-
const failed = results.filter(r => r.status === 'fail').length;
|
|
176
|
+
const passed = results.filter((r) => r.status === 'pass').length;
|
|
177
|
+
const failed = results.filter((r) => r.status === 'fail').length;
|
|
178
178
|
if (flags.output === 'json') {
|
|
179
179
|
this.log(JSON.stringify({ passed, failed, results }, null, 2));
|
|
180
180
|
}
|
|
@@ -182,7 +182,7 @@ Results: 2 passed, 1 failed
|
|
|
182
182
|
this.log(`\nResults: ${passed} passed, ${failed} failed`);
|
|
183
183
|
}
|
|
184
184
|
if (failed > 0) {
|
|
185
|
-
|
|
185
|
+
process.exitCode = 1;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
catch (error) {
|
|
@@ -198,8 +198,7 @@ Results: 2 passed, 1 failed
|
|
|
198
198
|
const configDir = path.join(os.homedir(), '.xano');
|
|
199
199
|
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
200
200
|
if (!fs.existsSync(credentialsPath)) {
|
|
201
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
202
|
-
`Create a profile using 'xano profile create'`);
|
|
201
|
+
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
203
202
|
}
|
|
204
203
|
try {
|
|
205
204
|
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
@@ -67,8 +67,8 @@ Results: 2 passed, 1 failed (2.691s total)
|
|
|
67
67
|
}
|
|
68
68
|
const listResponse = await this.verboseFetch(`${baseUrl}?${listParams}`, {
|
|
69
69
|
headers: {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
accept: 'application/json',
|
|
71
|
+
Authorization: `Bearer ${profile.access_token}`,
|
|
72
72
|
},
|
|
73
73
|
method: 'GET',
|
|
74
74
|
}, flags.verbose, profile.access_token);
|
|
@@ -76,7 +76,7 @@ Results: 2 passed, 1 failed (2.691s total)
|
|
|
76
76
|
const errorText = await listResponse.text();
|
|
77
77
|
this.error(`Failed to list workflow tests: ${listResponse.status}: ${listResponse.statusText}\n${errorText}`);
|
|
78
78
|
}
|
|
79
|
-
const data = await listResponse.json();
|
|
79
|
+
const data = (await listResponse.json());
|
|
80
80
|
let tests;
|
|
81
81
|
if (Array.isArray(data)) {
|
|
82
82
|
tests = data;
|
|
@@ -102,8 +102,8 @@ Results: 2 passed, 1 failed (2.691s total)
|
|
|
102
102
|
try {
|
|
103
103
|
const runResponse = await this.verboseFetch(runUrl, {
|
|
104
104
|
headers: {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
accept: 'application/json',
|
|
106
|
+
Authorization: `Bearer ${profile.access_token}`,
|
|
107
107
|
'Content-Type': 'application/json',
|
|
108
108
|
},
|
|
109
109
|
method: 'POST',
|
|
@@ -123,7 +123,7 @@ Results: 2 passed, 1 failed (2.691s total)
|
|
|
123
123
|
}
|
|
124
124
|
continue;
|
|
125
125
|
}
|
|
126
|
-
const runResult = await runResponse.json();
|
|
126
|
+
const runResult = (await runResponse.json());
|
|
127
127
|
const passed = runResult.status === 'ok';
|
|
128
128
|
const result = {
|
|
129
129
|
message: runResult.message,
|
|
@@ -161,8 +161,8 @@ Results: 2 passed, 1 failed (2.691s total)
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
// Step 3: Summary
|
|
164
|
-
const passed = results.filter(r => r.status === 'pass').length;
|
|
165
|
-
const failed = results.filter(r => r.status === 'fail').length;
|
|
164
|
+
const passed = results.filter((r) => r.status === 'pass').length;
|
|
165
|
+
const failed = results.filter((r) => r.status === 'fail').length;
|
|
166
166
|
if (flags.output === 'json') {
|
|
167
167
|
this.log(JSON.stringify({ passed, failed, total_timing: totalTiming, results }, null, 2));
|
|
168
168
|
}
|
|
@@ -170,7 +170,7 @@ Results: 2 passed, 1 failed (2.691s total)
|
|
|
170
170
|
this.log(`\nResults: ${passed} passed, ${failed} failed (${totalTiming.toFixed(3)}s total)`);
|
|
171
171
|
}
|
|
172
172
|
if (failed > 0) {
|
|
173
|
-
|
|
173
|
+
process.exitCode = 1;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
catch (error) {
|
|
@@ -186,8 +186,7 @@ Results: 2 passed, 1 failed (2.691s total)
|
|
|
186
186
|
const configDir = path.join(os.homedir(), '.xano');
|
|
187
187
|
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
188
188
|
if (!fs.existsSync(credentialsPath)) {
|
|
189
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
190
|
-
`Create a profile using 'xano profile create'`);
|
|
189
|
+
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
191
190
|
}
|
|
192
191
|
try {
|
|
193
192
|
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|