monocart-reporter 2.9.21 → 2.9.23

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.
package/README.md CHANGED
@@ -1128,7 +1128,7 @@ The `onEnd` function will be executed after report generated. Arguments:
1128
1128
  - `reportData` all report data, properties:
1129
1129
  - `name` (String) report name
1130
1130
  - `date` (Number) start date in milliseconds
1131
- - `dateH` (String) human-readable date with `Date.toLocaleString()`
1131
+ - `dateH` (String) human-readable date
1132
1132
  - `duration` (Number) test duration in milliseconds
1133
1133
  - `durationH` (String) human-readable duration
1134
1134
  - `summary` (Object) test summary, includes `tests`, `suites`, `steps`, etc.
@@ -127,13 +127,15 @@ const generateData = async (results) => {
127
127
  const locale = options.locale;
128
128
 
129
129
  // add one last tick before end time
130
- const timestamp = Util.addTimezoneOffset(Date.now(), timezoneOffset);
130
+ const timestamp = Date.now();
131
131
  const tickInfo = await getTickInfo(timestamp);
132
132
  system.ticks.push(tickInfo);
133
133
 
134
134
  // let start timestamp as date
135
135
  const date = system.timestampStart;
136
- const dateH = Util.dateFormat(date, locale);
136
+
137
+ const timezoneDate = Util.addTimezoneOffset(date, timezoneOffset);
138
+ const dateH = Util.dateFormat(timezoneDate, locale);
137
139
 
138
140
  // end timestamp for duration
139
141
  system.timestampEnd = timestamp;
@@ -204,13 +204,14 @@ const showTestResults = (reportData) => {
204
204
 
205
205
  // for shards
206
206
  const system = Array.isArray(reportData.system) ? reportData.system[0] : reportData.system;
207
+ // console.log(Util.dateFormat(reportData.date, reportData.locale));
207
208
 
208
209
  rows = rows.concat([{
209
210
  name: 'Playwright',
210
211
  value: `v${system.playwright}`
211
212
  }, {
212
213
  name: 'Date',
213
- value: Util.dateFormat(reportData.date, reportData.locale)
214
+ value: reportData.dateH
214
215
  }, {
215
216
  name: 'Duration',
216
217
  value: Util.TF(reportData.duration)
package/lib/index.js CHANGED
@@ -52,7 +52,7 @@ class MonocartReporter {
52
52
  this.testMap = new Map();
53
53
 
54
54
  this.system = getSystemInfo();
55
- this.system.timestampStart = Util.addTimezoneOffset(timestampStart, this.options.timezoneOffset);
55
+ this.system.timestampStart = timestampStart;
56
56
  this.system.ticks = [];
57
57
 
58
58
  this.tickTime = this.options.tickTime || 1000;
@@ -144,7 +144,7 @@ class MonocartReporter {
144
144
 
145
145
  tickStart() {
146
146
  this.tick_time_id = setTimeout(async () => {
147
- const timestamp = Util.addTimezoneOffset(Date.now(), this.options.timezoneOffset);
147
+ const timestamp = Date.now();
148
148
  const tickInfo = await getTickInfo(timestamp);
149
149
  this.system.ticks.push(tickInfo);
150
150
  this.tickStart();
@@ -206,7 +206,7 @@ class MonocartReporter {
206
206
  if (!test.timestamps) {
207
207
  test.timestamps = [];
208
208
  }
209
- test.timestamps.push(Util.addTimezoneOffset(Date.now(), this.options.timezoneOffset));
209
+ test.timestamps.push(Date.now());
210
210
 
211
211
  // keep logs here with order
212
212
  // result stderr and stdout without order
@@ -250,7 +250,7 @@ class MonocartReporter {
250
250
  }
251
251
 
252
252
  // timestamps
253
- test.timestamps.push(Util.addTimezoneOffset(Date.now(), this.options.timezoneOffset));
253
+ test.timestamps.push(Date.now());
254
254
 
255
255
  }
256
256
 
package/lib/merge-data.js CHANGED
@@ -336,7 +336,9 @@ const mergeDataList = async (dataList, options) => {
336
336
  const reportLogo = options.logo || mergedData.logo;
337
337
 
338
338
  const date = Math.min.apply(null, startDates);
339
- const dateH = Util.dateFormat(date, mergedData.locale);
339
+
340
+ const timezoneDate = Util.addTimezoneOffset(date, mergedData.timezoneOffset);
341
+ const dateH = Util.dateFormat(timezoneDate, mergedData.locale);
340
342
 
341
343
  const duration = Util.getDuration(dateRanges, options.durationStrategy);
342
344
  const durationH = Util.TF(duration);