newman-reporter-qase 1.0.5 → 1.0.6-alpha.2

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.
@@ -0,0 +1,30 @@
1
+ /* eslint-disable no-console */
2
+ /* eslint-disable camelcase */
3
+ const { QaseApi } = require('qaseio');
4
+ const chalk = require('chalk');
5
+
6
+ const config = JSON.parse(process.env?.reporting_config);
7
+
8
+ const publishBulkResult = async () => {
9
+ if (config) {
10
+ console.log('Publishing is started');
11
+
12
+ const api = new QaseApi(config.apiToken, config.basePath, config.headers);
13
+
14
+ try {
15
+ const res = await api.results.createResultBulk(
16
+ config.code,
17
+ config.runId,
18
+ config.body
19
+ );
20
+
21
+ if (res.status === 200) {
22
+ console.log(chalk`{green Results are sent}`);
23
+ }
24
+ } catch (error) {
25
+ console.log('Error till publishing', error);
26
+ }
27
+ }
28
+ };
29
+
30
+ publishBulkResult();