fleetmap-reports 1.0.775 → 1.0.776
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/package.json
CHANGED
|
@@ -136,8 +136,8 @@ function getDeviceData (allInOne, d) {
|
|
|
136
136
|
const hardAcceleration = deviceRoute.filter(p => p.attributes.io253 === 1).length
|
|
137
137
|
|
|
138
138
|
return {
|
|
139
|
-
drivingTime,
|
|
140
|
-
idleTime,
|
|
139
|
+
drivingTime: drivingTime / 1000,
|
|
140
|
+
idleTime: idleTime / 1000,
|
|
141
141
|
cruiseControlTime: 0,
|
|
142
142
|
economicTime: 0,
|
|
143
143
|
highEngineRPM: 0,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
const { getReports } = require('./index')
|
|
2
2
|
const { createPerformanceReport } = require('../partnerReports/performance-report')
|
|
3
3
|
const assert = require('assert')
|
|
4
|
+
const { convertMS } = require('../util/utils')
|
|
4
5
|
// eslint-disable-next-line no-undef
|
|
5
6
|
describe('performance', function () {
|
|
6
7
|
// eslint-disable-next-line no-undef
|
|
7
|
-
it('performance report', async () => {
|
|
8
|
+
it('performance report teltonika', async () => {
|
|
8
9
|
const report = await getReports()
|
|
9
10
|
const userData = await report.getUserData()
|
|
10
11
|
userData.devices = userData.devices.filter(d => d.id === 22326)
|
|
@@ -13,11 +14,13 @@ describe('performance', function () {
|
|
|
13
14
|
new Date(Date.UTC(2023, 5, 20, 23, 59, 59, 0)),
|
|
14
15
|
userData,
|
|
15
16
|
report.traccar)
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
assert.equal(data[0].consumption, 21.8)
|
|
18
|
+
assert.equal(data[0].distance, 381.29861000000005)
|
|
19
|
+
assert.equal(convertMS(data[1].time * 1000, false), '10:30')
|
|
20
|
+
}, 8000000)
|
|
18
21
|
|
|
19
22
|
// eslint-disable-next-line no-undef
|
|
20
|
-
it('performance report
|
|
23
|
+
it('performance report inofleet', async () => {
|
|
21
24
|
const report = await getReports()
|
|
22
25
|
const userData = await report.getUserData()
|
|
23
26
|
userData.devices = userData.devices.filter(d => d.id === 69114)
|