Skip to content

Commit d7b27e2

Browse files
committed
[exoframe-client] Fix logging of streamed server response
Correctly pass log function to streamer, fix test in client and cli
1 parent 4cf98cb commit d7b27e2

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

packages/exoframe-cli/test/deploy.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,11 @@ test('Should display verbose output', async () => {
589589
"exoframe.json",
590590
],
591591
],
592+
[
593+
"[error]",
594+
"Error parsing line:",
595+
"Bad Gateway",
596+
],
592597
[
593598
"Error deploying project:",
594599
"Bad Gateway",

packages/exoframe-client/src/deploy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export const deploy = async ({ folder, endpoint, token, update, configFile = 'ex
210210
const options = { headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/octet-stream' } };
211211

212212
// pipe stream to remote
213-
const res = await streamToResponse({ tarStream, remoteUrl, options, verbose });
213+
const res = await streamToResponse({ tarStream, remoteUrl, options, verbose, log });
214214
// check deployments
215215
if (!res?.deployments?.length) {
216216
const err = new Error('Something went wrong!');

packages/exoframe-client/test/deploy.test.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ test('Should deploy', async () => {
9393
".exoframeignore",
9494
],
9595
],
96+
[
97+
"[info]",
98+
"Deployment success!",
99+
],
96100
[
97101
"Server response:",
98102
"{
@@ -183,6 +187,10 @@ test('Should deploy with endpoint flag', async () => {
183187
".exoframeignore",
184188
],
185189
],
190+
[
191+
"[info]",
192+
"Deployment success!",
193+
],
186194
[
187195
"Server response:",
188196
"{
@@ -262,6 +270,10 @@ test('Should execute update', async () => {
262270
".exoframeignore",
263271
],
264272
],
273+
[
274+
"[info]",
275+
"Deployment success!",
276+
],
265277
[
266278
"Server response:",
267279
"{
@@ -316,7 +328,7 @@ test('Should deploy with custom config', async () => {
316328
const fileNames = [];
317329
s.pipe(
318330
tar.extract('./', {
319-
ignore: (name, header) => {
331+
ignore: (name) => {
320332
fileNames.push(name.split('/').pop());
321333
return true;
322334
},
@@ -371,6 +383,10 @@ test('Should deploy with custom config', async () => {
371383
"exoframe.json",
372384
],
373385
],
386+
[
387+
"[info]",
388+
"Deployment success!",
389+
],
374390
[
375391
"Server response:",
376392
"{
@@ -525,6 +541,10 @@ test('Should ignore specified files', async () => {
525541
".exoframeignore",
526542
],
527543
],
544+
[
545+
"[info]",
546+
"Deployment success!",
547+
],
528548
[
529549
"Server response:",
530550
"{

0 commit comments

Comments
 (0)