qase-javascript-commons 2.0.0-beta.0 → 2.0.0-beta.1

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.
Files changed (73) hide show
  1. package/dist/config/config-loader-interface.d.ts +4 -0
  2. package/dist/config/config-loader-interface.js +2 -0
  3. package/dist/config/config-loader.d.ts +10 -0
  4. package/dist/config/config-loader.js +58 -0
  5. package/dist/config/config-type.d.ts +2 -0
  6. package/dist/config/config-type.js +2 -0
  7. package/dist/config/config-validation-schema.d.ts +6 -0
  8. package/dist/config/config-validation-schema.js +133 -0
  9. package/dist/config/index.d.ts +4 -0
  10. package/dist/config/index.js +7 -0
  11. package/dist/env/env-enum.d.ts +40 -0
  12. package/dist/env/env-enum.js +48 -0
  13. package/dist/env/env-to-config.d.ts +7 -0
  14. package/dist/env/env-to-config.js +39 -0
  15. package/dist/env/env-type.d.ts +19 -0
  16. package/dist/env/env-type.js +3 -0
  17. package/dist/env/env-validation-schema.d.ts +6 -0
  18. package/dist/env/env-validation-schema.js +74 -0
  19. package/dist/env/index.d.ts +4 -0
  20. package/dist/env/index.js +13 -0
  21. package/dist/formatter/formatter-interface.d.ts +3 -0
  22. package/dist/formatter/formatter-interface.js +2 -0
  23. package/dist/formatter/index.d.ts +2 -0
  24. package/dist/formatter/index.js +5 -0
  25. package/dist/formatter/json-formatter.d.ts +13 -0
  26. package/dist/formatter/json-formatter.js +27 -0
  27. package/dist/index.d.ts +9 -0
  28. package/dist/index.js +25 -0
  29. package/dist/models/index.d.ts +2 -0
  30. package/dist/models/index.js +7 -0
  31. package/dist/models/test-result.d.ts +25 -0
  32. package/dist/models/test-result.js +15 -0
  33. package/dist/models/test-step.d.ts +14 -0
  34. package/dist/models/test-step.js +9 -0
  35. package/dist/options/composeOptions.d.ts +9 -0
  36. package/dist/options/composeOptions.js +12 -0
  37. package/dist/options/index.d.ts +3 -0
  38. package/dist/options/index.js +7 -0
  39. package/dist/options/mode-enum.d.ts +8 -0
  40. package/dist/options/mode-enum.js +12 -0
  41. package/dist/options/options-type.d.ts +31 -0
  42. package/dist/options/options-type.js +3 -0
  43. package/dist/qase.d.ts +53 -0
  44. package/dist/qase.js +180 -0
  45. package/dist/reporters/abstract-reporter.d.ts +68 -0
  46. package/dist/reporters/abstract-reporter.js +101 -0
  47. package/dist/reporters/index.d.ts +3 -0
  48. package/dist/reporters/index.js +9 -0
  49. package/dist/reporters/report-reporter.d.ts +31 -0
  50. package/dist/reporters/report-reporter.js +40 -0
  51. package/dist/reporters/testops-reporter.d.ts +136 -0
  52. package/dist/reporters/testops-reporter.js +300 -0
  53. package/dist/utils/custom-boundary.d.ts +26 -0
  54. package/dist/utils/custom-boundary.js +30 -0
  55. package/dist/utils/disabled-exception.d.ts +6 -0
  56. package/dist/utils/disabled-exception.js +10 -0
  57. package/dist/utils/get-package-version.d.ts +5 -0
  58. package/dist/utils/get-package-version.js +25 -0
  59. package/dist/utils/is-axios-error.d.ts +6 -0
  60. package/dist/utils/is-axios-error.js +11 -0
  61. package/dist/utils/qase-error.d.ts +18 -0
  62. package/dist/utils/qase-error.js +15 -0
  63. package/dist/utils/validate-json.d.ts +20 -0
  64. package/dist/utils/validate-json.js +40 -0
  65. package/dist/writer/driver-enum.d.ts +6 -0
  66. package/dist/writer/driver-enum.js +10 -0
  67. package/dist/writer/fs-writer.d.ts +26 -0
  68. package/dist/writer/fs-writer.js +59 -0
  69. package/dist/writer/index.d.ts +3 -0
  70. package/dist/writer/index.js +7 -0
  71. package/dist/writer/writer-interface.d.ts +4 -0
  72. package/dist/writer/writer-interface.js +2 -0
  73. package/package.json +2 -2
@@ -0,0 +1,26 @@
1
+ import { WriterInterface } from './writer-interface';
2
+ import { TestResultType } from '../models';
3
+ import { FormatterInterface } from '../formatter';
4
+ export type FsWriterOptionsType = {
5
+ path?: string | undefined;
6
+ ext?: string | undefined;
7
+ };
8
+ /**
9
+ * @class FsWriter
10
+ * @implements WriterInterface
11
+ */
12
+ export declare class FsWriter implements WriterInterface {
13
+ private formatter;
14
+ private path;
15
+ private ext;
16
+ /**
17
+ * @param {FsWriterOptionsType | undefined} options
18
+ * @param {FormatterInterface} formatter
19
+ */
20
+ constructor(options: FsWriterOptionsType | undefined, formatter: FormatterInterface);
21
+ /**
22
+ * @param {TestResultType[]} results
23
+ * @returns {Promise<string>}
24
+ */
25
+ write(results: TestResultType[]): Promise<string>;
26
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.FsWriter = void 0;
27
+ const fs_1 = require("fs");
28
+ const path = __importStar(require("path"));
29
+ /**
30
+ * @class FsWriter
31
+ * @implements WriterInterface
32
+ */
33
+ class FsWriter {
34
+ /**
35
+ * @param {FsWriterOptionsType | undefined} options
36
+ * @param {FormatterInterface} formatter
37
+ */
38
+ constructor(options, formatter) {
39
+ this.formatter = formatter;
40
+ const { path: pathOptions = path.join('build', 'qase-report'), ext = 'json', } = options ?? {};
41
+ this.path = pathOptions;
42
+ this.ext = ext;
43
+ }
44
+ /**
45
+ * @param {TestResultType[]} results
46
+ * @returns {Promise<string>}
47
+ */
48
+ // eslint-disable-next-line @typescript-eslint/require-await
49
+ async write(results) {
50
+ try {
51
+ (0, fs_1.mkdirSync)(this.path, { recursive: true });
52
+ }
53
+ catch (error) { /* ignore */ }
54
+ const filePath = path.join(this.path, `results-${Date.now()}.${this.ext}`);
55
+ (0, fs_1.writeFileSync)(filePath, await this.formatter.format(results));
56
+ return filePath;
57
+ }
58
+ }
59
+ exports.FsWriter = FsWriter;
@@ -0,0 +1,3 @@
1
+ export { type WriterInterface } from './writer-interface';
2
+ export { FsWriter, type FsWriterOptionsType } from './fs-writer';
3
+ export { DriverEnum } from './driver-enum';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DriverEnum = exports.FsWriter = void 0;
4
+ var fs_writer_1 = require("./fs-writer");
5
+ Object.defineProperty(exports, "FsWriter", { enumerable: true, get: function () { return fs_writer_1.FsWriter; } });
6
+ var driver_enum_1 = require("./driver-enum");
7
+ Object.defineProperty(exports, "DriverEnum", { enumerable: true, get: function () { return driver_enum_1.DriverEnum; } });
@@ -0,0 +1,4 @@
1
+ import { TestResultType } from '../models';
2
+ export interface WriterInterface {
3
+ write(results: TestResultType[]): Promise<string>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qase-javascript-commons",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.1",
4
4
  "description": "Qase JS Reporters",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  "lodash.get": "^4.4.2",
32
32
  "lodash.merge": "^4.6.2",
33
33
  "lodash.mergewith": "^4.6.2",
34
- "qaseio": "^2.0.3-beta.0",
34
+ "qaseio": "^2.0.3-beta.1",
35
35
  "strip-ansi": "^6.0.1",
36
36
  "uuid": "^9.0.0"
37
37
  },