html-reporter 10.10.0 → 10.11.0

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.
@@ -6,6 +6,7 @@ export declare const ClientEvents: {
6
6
  readonly RETRY: "retry";
7
7
  readonly ERROR: "err";
8
8
  readonly END: "end";
9
+ readonly CONNECTED: "connected";
9
10
  };
10
11
  export type ClientEvents = typeof ClientEvents;
11
12
  export type ClientEvent = ValueOf<ClientEvents>;
@@ -7,6 +7,7 @@ exports.ClientEvents = {
7
7
  TEST_RESULT: 'testResult',
8
8
  RETRY: 'retry',
9
9
  ERROR: 'err',
10
- END: 'end'
10
+ END: 'end',
11
+ CONNECTED: 'connected'
11
12
  };
12
13
  //# sourceMappingURL=client-events.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-events.js","sourceRoot":"","sources":["../../../../lib/gui/constants/client-events.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAAG;IACxB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,YAAY;IAEzB,WAAW,EAAE,YAAY;IAEzB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,KAAK;IAEZ,GAAG,EAAE,KAAK;CACJ,CAAC"}
1
+ {"version":3,"file":"client-events.js","sourceRoot":"","sources":["../../../../lib/gui/constants/client-events.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAAG;IACxB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,YAAY;IAEzB,WAAW,EAAE,YAAY;IAEzB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,KAAK;IAEZ,GAAG,EAAE,KAAK;IAEV,SAAS,EAAE,WAAW;CAChB,CAAC"}
@@ -2,6 +2,7 @@ import { Response } from 'express';
2
2
  export declare class EventSource {
3
3
  private _connections;
4
4
  constructor();
5
+ private _write;
5
6
  addConnection(connection: Response): void;
6
7
  emit(event: string, data?: unknown): void;
7
8
  }
@@ -5,18 +5,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.EventSource = void 0;
7
7
  const json_stringify_safe_1 = __importDefault(require("json-stringify-safe"));
8
+ const constants_1 = require("./constants");
8
9
  class EventSource {
9
10
  constructor() {
10
11
  this._connections = [];
11
12
  }
13
+ _write(connection, event, data) {
14
+ connection.write('event: ' + event + '\n');
15
+ connection.write('data: ' + (0, json_stringify_safe_1.default)(data) + '\n');
16
+ connection.write('\n\n');
17
+ }
12
18
  addConnection(connection) {
13
19
  this._connections.push(connection);
20
+ this._write(connection, constants_1.ClientEvents.CONNECTED, 1);
14
21
  }
15
22
  emit(event, data) {
16
- this._connections.forEach(function (connection) {
17
- connection.write('event: ' + event + '\n');
18
- connection.write('data: ' + (0, json_stringify_safe_1.default)(data) + '\n');
19
- connection.write('\n\n');
23
+ this._connections.forEach((connection) => {
24
+ this._write(connection, event, data);
20
25
  });
21
26
  }
22
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"event-source.js","sourceRoot":"","sources":["../../../lib/gui/event-source.ts"],"names":[],"mappings":";;;;;;AACA,8EAA4C;AAE5C,MAAa,WAAW;IAEpB;QACI,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED,aAAa,CAAC,UAAoB;QAC9B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,CAAC,KAAa,EAAE,IAAc;QAC9B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,UAAS,UAAU;YACzC,UAAU,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC;YAC3C,UAAU,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAA,6BAAS,EAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YACpD,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAjBD,kCAiBC"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