Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newman fix #177

Merged
merged 2 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const { randomUUID } = require('crypto');
const upload = require('./fileUploader');
const { APP_PREFIX } = require('./constants');
const pipesFactory = require('./pipe');
const logger = require('./logger');

/**
* @typedef {import('../types').TestData} TestData
Expand Down Expand Up @@ -103,6 +102,7 @@ class Client {
stack = this.formatSteps(stack, steps);
}

const logger = require('./logger');
const testLogs = logger.getLogs(test_id);
debug(`Test logs for ${test_id}:\n`, testLogs);
if (stack) stack += '\n\n';
Expand Down Expand Up @@ -150,17 +150,19 @@ class Client {
artifacts,
};

this.queue = this.queue
.then(() => Promise.all(this.pipes.map(async p => {
try {
const result = await p.addTest(data);
return { pipe: p.toString(), result };
} catch (err) {
console.log(APP_PREFIX, p.toString(), err);
}
}
)));

this.queue = this.queue.then(() =>
Promise.all(
this.pipes.map(async p => {
try {
const result = await p.addTest(data);
return { pipe: p.toString(), result };
} catch (err) {
console.log(APP_PREFIX, p.toString(), err);
}
}),
),
);

return this.queue;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/newman-reporter-testomatio/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function TestomatioNewmanReporter(emitter: AnyObject, reporterOptions: AnyObject
log('Test data sent:', testData);

// notify Testomatio about the item result
testomatioReporter.addTestRun(null, newmanItemStore.testStatus || 'passed' as TestStatus, testData);
testomatioReporter.addTestRun(newmanItemStore.testStatus || 'passed' as TestStatus, testData);
});

// test assertion
Expand Down
Loading