@sports-alliance/sports-lib 6.1.13 → 7.0.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.
@@ -0,0 +1,10 @@
1
+ const { FitParser } = require('fit-file-parser');
2
+ console.log('Successfully required FitParser');
3
+ try {
4
+ const parser = new FitParser();
5
+ console.log('Parser instance created');
6
+ const resolvedPath = require.resolve('fit-file-parser');
7
+ console.log('Resolved path:', resolvedPath);
8
+ } catch (e) {
9
+ console.error('Error:', e);
10
+ }
@@ -153,7 +153,7 @@ class EventImporterSuuntoJSON {
153
153
  // Create the activities
154
154
  const activities = activityStartEventSamples.map((activityStartEventSample, index) => {
155
155
  const activity = new activity_1.Activity(new Date(activityStartEventSample.TimeISO8601), activityStartEventSamples.length - 1 === index
156
- ? new Date(stopEventSample ? stopEventSample.TimeISO8601 : eventJSONObject.DeviceLog.Header.TimeISO8601)
156
+ ? new Date(stopEventSample ? stopEventSample.TimeISO8601 : (eventJSONObject.DeviceLog.Header.TimeISO8601 || eventJSONObject.DeviceLog.Header.DateTime))
157
157
  : new Date(activityStartEventSamples[index + 1].TimeISO8601), activity_types_1.ActivityTypes[(importer_suunto_activity_ids_1.ImporterSuuntoActivityIds[activityStartEventSample.Events[0].Activity.ActivityType])], creator, options);
158
158
  // Set the end date to the stop event time if the activity is the last or the only one else set it on the next itery time
159
159
  // Create the stats these are a 1:1 ref arrays
@@ -1,5 +1,5 @@
1
1
  import { SerializableClassInterface } from '../serializable/serializable.class.interface';
2
- import { COROSAPIEventMetaDataJsonInterface, EventMetaDataJsonInterface, GarminHealthAPIEventMetaDataJsonInterface, SuuntoAppEventMetaDataJsonInterface } from './meta-data.json.interface';
2
+ import { COROSAPIEventMetaDataJsonInterface, EventMetaDataJsonInterface, GarminAPIEventMetaDataJsonInterface as GarminAPIEventMetaDataJsonInterface, SuuntoAppEventMetaDataJsonInterface } from './meta-data.json.interface';
3
3
  export interface EventMetaDataInterface extends SerializableClassInterface {
4
4
  serviceName: ServiceNames;
5
5
  date: Date;
@@ -16,16 +16,16 @@ export interface COROSAPIEventMetaDataInterface extends EventMetaDataInterface {
16
16
  serviceFITFileURI: string;
17
17
  toJSON(): COROSAPIEventMetaDataJsonInterface;
18
18
  }
19
- export interface GarminHealthAPIEventMetaDataInterface extends EventMetaDataInterface {
19
+ export interface GarminAPIEventMetaDataInterface extends EventMetaDataInterface {
20
20
  serviceUserID: string;
21
21
  serviceActivityFileID: string;
22
22
  serviceActivityFileType: 'FIT' | 'TCX' | 'GPX';
23
23
  serviceStartTimeInSeconds: number;
24
24
  serviceManual: boolean;
25
- toJSON(): GarminHealthAPIEventMetaDataJsonInterface;
25
+ toJSON(): GarminAPIEventMetaDataJsonInterface;
26
26
  }
27
27
  export declare enum ServiceNames {
28
28
  SuuntoApp = "Suunto app",
29
- GarminHealthAPI = "Garmin Health API",
29
+ GarminAPI = "Garmin API",
30
30
  COROSAPI = "COROS API"
31
31
  }
@@ -4,6 +4,6 @@ exports.ServiceNames = void 0;
4
4
  var ServiceNames;
5
5
  (function (ServiceNames) {
6
6
  ServiceNames["SuuntoApp"] = "Suunto app";
7
- ServiceNames["GarminHealthAPI"] = "Garmin Health API";
7
+ ServiceNames["GarminAPI"] = "Garmin API";
8
8
  ServiceNames["COROSAPI"] = "COROS API";
9
9
  })(ServiceNames = exports.ServiceNames || (exports.ServiceNames = {}));
@@ -1,5 +1,5 @@
1
- import { COROSAPIEventMetaDataInterface, GarminHealthAPIEventMetaDataInterface, ServiceNames, SuuntoAppEventMetaDataInterface } from './event-meta-data.interface';
2
- import { COROSAPIEventMetaDataJsonInterface, GarminHealthAPIEventMetaDataJsonInterface, SuuntoAppEventMetaDataJsonInterface } from './meta-data.json.interface';
1
+ import { COROSAPIEventMetaDataInterface, GarminAPIEventMetaDataInterface, ServiceNames, SuuntoAppEventMetaDataInterface } from './event-meta-data.interface';
2
+ import { COROSAPIEventMetaDataJsonInterface, GarminAPIEventMetaDataJsonInterface, SuuntoAppEventMetaDataJsonInterface } from './meta-data.json.interface';
3
3
  export declare class SuuntoAppEventMetaData implements SuuntoAppEventMetaDataInterface {
4
4
  serviceWorkoutID: string;
5
5
  serviceUserName: string;
@@ -17,7 +17,7 @@ export declare class COROSAPIEventMetaData implements COROSAPIEventMetaDataInter
17
17
  constructor(serviceWorkoutID: string, serviceOpenId: string, serviceFITFileURI: string, date: Date);
18
18
  toJSON(): COROSAPIEventMetaDataJsonInterface;
19
19
  }
20
- export declare class GarminHealthAPIEventMetaData implements GarminHealthAPIEventMetaDataInterface {
20
+ export declare class GarminAPIEventMetaData implements GarminAPIEventMetaDataInterface {
21
21
  serviceUserID: string;
22
22
  serviceActivityFileID: string;
23
23
  serviceActivityFileType: 'FIT' | 'TCX' | 'GPX';
@@ -26,5 +26,5 @@ export declare class GarminHealthAPIEventMetaData implements GarminHealthAPIEven
26
26
  date: Date;
27
27
  serviceName: ServiceNames;
28
28
  constructor(serviceUserID: string, serviceActivityFileID: string, serviceActivityFileType: 'FIT' | 'TCX' | 'GPX', serviceManual: boolean, serviceStartTimeInSeconds: number, date: Date);
29
- toJSON(): GarminHealthAPIEventMetaDataJsonInterface;
29
+ toJSON(): GarminAPIEventMetaDataJsonInterface;
30
30
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GarminHealthAPIEventMetaData = exports.COROSAPIEventMetaData = exports.SuuntoAppEventMetaData = void 0;
3
+ exports.GarminAPIEventMetaData = exports.COROSAPIEventMetaData = exports.SuuntoAppEventMetaData = void 0;
4
4
  const event_meta_data_interface_1 = require("./event-meta-data.interface");
5
5
  class SuuntoAppEventMetaData {
6
6
  constructor(serviceWorkoutID, serviceUserName, date) {
@@ -38,7 +38,7 @@ class COROSAPIEventMetaData {
38
38
  }
39
39
  }
40
40
  exports.COROSAPIEventMetaData = COROSAPIEventMetaData;
41
- class GarminHealthAPIEventMetaData {
41
+ class GarminAPIEventMetaData {
42
42
  constructor(serviceUserID, serviceActivityFileID, serviceActivityFileType, serviceManual, serviceStartTimeInSeconds, date) {
43
43
  this.serviceUserID = serviceUserID;
44
44
  this.serviceActivityFileID = serviceActivityFileID;
@@ -46,7 +46,7 @@ class GarminHealthAPIEventMetaData {
46
46
  this.serviceManual = serviceManual;
47
47
  this.serviceStartTimeInSeconds = serviceStartTimeInSeconds;
48
48
  this.date = date;
49
- this.serviceName = event_meta_data_interface_1.ServiceNames.GarminHealthAPI;
49
+ this.serviceName = event_meta_data_interface_1.ServiceNames.GarminAPI;
50
50
  }
51
51
  toJSON() {
52
52
  return {
@@ -60,4 +60,4 @@ class GarminHealthAPIEventMetaData {
60
60
  };
61
61
  }
62
62
  }
63
- exports.GarminHealthAPIEventMetaData = GarminHealthAPIEventMetaData;
63
+ exports.GarminAPIEventMetaData = GarminAPIEventMetaData;
@@ -12,7 +12,7 @@ export interface COROSAPIEventMetaDataJsonInterface extends EventMetaDataJsonInt
12
12
  serviceWorkoutID: string;
13
13
  serviceFITFileURI: string;
14
14
  }
15
- export interface GarminHealthAPIEventMetaDataJsonInterface extends EventMetaDataJsonInterface {
15
+ export interface GarminAPIEventMetaDataJsonInterface extends EventMetaDataJsonInterface {
16
16
  serviceUserID: string;
17
17
  serviceActivityFileID: string;
18
18
  serviceActivityFileType: 'FIT' | 'TCX' | 'GPX';
@@ -150,7 +150,7 @@ export class EventImporterSuuntoJSON {
150
150
  // Create the activities
151
151
  const activities = activityStartEventSamples.map((activityStartEventSample, index) => {
152
152
  const activity = new Activity(new Date(activityStartEventSample.TimeISO8601), activityStartEventSamples.length - 1 === index
153
- ? new Date(stopEventSample ? stopEventSample.TimeISO8601 : eventJSONObject.DeviceLog.Header.TimeISO8601)
153
+ ? new Date(stopEventSample ? stopEventSample.TimeISO8601 : (eventJSONObject.DeviceLog.Header.TimeISO8601 || eventJSONObject.DeviceLog.Header.DateTime))
154
154
  : new Date(activityStartEventSamples[index + 1].TimeISO8601), ActivityTypes[(ImporterSuuntoActivityIds[activityStartEventSample.Events[0].Activity.ActivityType])], creator, options);
155
155
  // Set the end date to the stop event time if the activity is the last or the only one else set it on the next itery time
156
156
  // Create the stats these are a 1:1 ref arrays
@@ -1,5 +1,5 @@
1
1
  import { SerializableClassInterface } from '../serializable/serializable.class.interface';
2
- import { COROSAPIEventMetaDataJsonInterface, EventMetaDataJsonInterface, GarminHealthAPIEventMetaDataJsonInterface, SuuntoAppEventMetaDataJsonInterface } from './meta-data.json.interface';
2
+ import { COROSAPIEventMetaDataJsonInterface, EventMetaDataJsonInterface, GarminAPIEventMetaDataJsonInterface as GarminAPIEventMetaDataJsonInterface, SuuntoAppEventMetaDataJsonInterface } from './meta-data.json.interface';
3
3
  export interface EventMetaDataInterface extends SerializableClassInterface {
4
4
  serviceName: ServiceNames;
5
5
  date: Date;
@@ -16,16 +16,16 @@ export interface COROSAPIEventMetaDataInterface extends EventMetaDataInterface {
16
16
  serviceFITFileURI: string;
17
17
  toJSON(): COROSAPIEventMetaDataJsonInterface;
18
18
  }
19
- export interface GarminHealthAPIEventMetaDataInterface extends EventMetaDataInterface {
19
+ export interface GarminAPIEventMetaDataInterface extends EventMetaDataInterface {
20
20
  serviceUserID: string;
21
21
  serviceActivityFileID: string;
22
22
  serviceActivityFileType: 'FIT' | 'TCX' | 'GPX';
23
23
  serviceStartTimeInSeconds: number;
24
24
  serviceManual: boolean;
25
- toJSON(): GarminHealthAPIEventMetaDataJsonInterface;
25
+ toJSON(): GarminAPIEventMetaDataJsonInterface;
26
26
  }
27
27
  export declare enum ServiceNames {
28
28
  SuuntoApp = "Suunto app",
29
- GarminHealthAPI = "Garmin Health API",
29
+ GarminAPI = "Garmin API",
30
30
  COROSAPI = "COROS API"
31
31
  }
@@ -1,6 +1,6 @@
1
1
  export var ServiceNames;
2
2
  (function (ServiceNames) {
3
3
  ServiceNames["SuuntoApp"] = "Suunto app";
4
- ServiceNames["GarminHealthAPI"] = "Garmin Health API";
4
+ ServiceNames["GarminAPI"] = "Garmin API";
5
5
  ServiceNames["COROSAPI"] = "COROS API";
6
6
  })(ServiceNames || (ServiceNames = {}));
@@ -1,5 +1,5 @@
1
- import { COROSAPIEventMetaDataInterface, GarminHealthAPIEventMetaDataInterface, ServiceNames, SuuntoAppEventMetaDataInterface } from './event-meta-data.interface';
2
- import { COROSAPIEventMetaDataJsonInterface, GarminHealthAPIEventMetaDataJsonInterface, SuuntoAppEventMetaDataJsonInterface } from './meta-data.json.interface';
1
+ import { COROSAPIEventMetaDataInterface, GarminAPIEventMetaDataInterface, ServiceNames, SuuntoAppEventMetaDataInterface } from './event-meta-data.interface';
2
+ import { COROSAPIEventMetaDataJsonInterface, GarminAPIEventMetaDataJsonInterface, SuuntoAppEventMetaDataJsonInterface } from './meta-data.json.interface';
3
3
  export declare class SuuntoAppEventMetaData implements SuuntoAppEventMetaDataInterface {
4
4
  serviceWorkoutID: string;
5
5
  serviceUserName: string;
@@ -17,7 +17,7 @@ export declare class COROSAPIEventMetaData implements COROSAPIEventMetaDataInter
17
17
  constructor(serviceWorkoutID: string, serviceOpenId: string, serviceFITFileURI: string, date: Date);
18
18
  toJSON(): COROSAPIEventMetaDataJsonInterface;
19
19
  }
20
- export declare class GarminHealthAPIEventMetaData implements GarminHealthAPIEventMetaDataInterface {
20
+ export declare class GarminAPIEventMetaData implements GarminAPIEventMetaDataInterface {
21
21
  serviceUserID: string;
22
22
  serviceActivityFileID: string;
23
23
  serviceActivityFileType: 'FIT' | 'TCX' | 'GPX';
@@ -26,5 +26,5 @@ export declare class GarminHealthAPIEventMetaData implements GarminHealthAPIEven
26
26
  date: Date;
27
27
  serviceName: ServiceNames;
28
28
  constructor(serviceUserID: string, serviceActivityFileID: string, serviceActivityFileType: 'FIT' | 'TCX' | 'GPX', serviceManual: boolean, serviceStartTimeInSeconds: number, date: Date);
29
- toJSON(): GarminHealthAPIEventMetaDataJsonInterface;
29
+ toJSON(): GarminAPIEventMetaDataJsonInterface;
30
30
  }
@@ -33,7 +33,7 @@ export class COROSAPIEventMetaData {
33
33
  };
34
34
  }
35
35
  }
36
- export class GarminHealthAPIEventMetaData {
36
+ export class GarminAPIEventMetaData {
37
37
  constructor(serviceUserID, serviceActivityFileID, serviceActivityFileType, serviceManual, serviceStartTimeInSeconds, date) {
38
38
  this.serviceUserID = serviceUserID;
39
39
  this.serviceActivityFileID = serviceActivityFileID;
@@ -41,7 +41,7 @@ export class GarminHealthAPIEventMetaData {
41
41
  this.serviceManual = serviceManual;
42
42
  this.serviceStartTimeInSeconds = serviceStartTimeInSeconds;
43
43
  this.date = date;
44
- this.serviceName = ServiceNames.GarminHealthAPI;
44
+ this.serviceName = ServiceNames.GarminAPI;
45
45
  }
46
46
  toJSON() {
47
47
  return {
@@ -12,7 +12,7 @@ export interface COROSAPIEventMetaDataJsonInterface extends EventMetaDataJsonInt
12
12
  serviceWorkoutID: string;
13
13
  serviceFITFileURI: string;
14
14
  }
15
- export interface GarminHealthAPIEventMetaDataJsonInterface extends EventMetaDataJsonInterface {
15
+ export interface GarminAPIEventMetaDataJsonInterface extends EventMetaDataJsonInterface {
16
16
  serviceUserID: string;
17
17
  serviceActivityFileID: string;
18
18
  serviceActivityFileType: 'FIT' | 'TCX' | 'GPX';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sports-alliance/sports-lib",
3
- "version": "6.1.13",
3
+ "version": "7.0.0",
4
4
  "description": "A Library to for importing / exporting and processing GPX, TCX, FIT and JSON files from services such as Strava, Movescount, Garmin, Polar etc",
5
5
  "keywords": [
6
6
  "gpx",
@@ -0,0 +1,162 @@
1
+ ts-jest[ts-jest-transformer] (WARN) Define `ts-jest` config under `globals` is deprecated. Please do
2
+ transform: {
3
+ <transform_regex>: ['ts-jest', { /* ts-jest config goes here in Jest */ }],
4
+ },
5
+ See more at https://kulshekhar.github.io/ts-jest/docs/getting-started/presets#advanced
6
+ console.log
7
+ Jest Setup: Enabled ActivityParsingOptions.generateUnitStreams.
8
+
9
+ at Object.log (jest.setup.ts:8:9)
10
+
11
+ [DEBUG-FORCE] fit-parser.js LOADING via process.stdout
12
+ console.error
13
+ [DEBUG-FORCE] fit-parser.js LOADING via console.error
14
+
15
+ 111 | // eslint-disable-next-line @typescript-eslint/no-var-requires
16
+ 112 | // @ts-ignore
17
+ > 113 | import FitFileParser from 'fit-file-parser';
18
+ | ^
19
+ 114 | try {
20
+ 115 | console.log('[DEBUG-JEST-RESOLVE] fit-file-parser resolves to:', require.resolve('fit-file-parser'));
21
+ 116 | } catch (e) {
22
+
23
+ at Object.error (node_modules/fit-file-parser/dist/cjs/fit-parser.js:6:9)
24
+ at Object.require (src/events/adapters/importers/fit/importer.fit.ts:113:1)
25
+ at Object.require (src/index.ts:4:1)
26
+ at Object.require (src/specs/activities-parsing.integration.spec.ts:2:1)
27
+
28
+ console.log
29
+ [DEBUG-JEST-RESOLVE] fit-file-parser resolves to: /Users/dimitrios/Projects/sports-lib/node_modules/fit-file-parser/dist/cjs/fit-parser.js
30
+
31
+ at Object.log (src/events/adapters/importers/fit/importer.fit.ts:115:11)
32
+
33
+ console.log
34
+ [DEBUG] Start parsing FIT file (1)
35
+
36
+ at Object.log (src/specs/activities-parsing.integration.spec.ts:119:17)
37
+
38
+ console.log
39
+ [DEBUG-FIT-PARSER] CJS helper.js LOADED - Patched Version
40
+
41
+ at log (node_modules/fit-file-parser/dist/cjs/helper.js:8:13)
42
+
43
+ console.log
44
+ [DEBUG-FIT-PARSER] CJS helper.js LOADED - Patched Version
45
+
46
+ at log (node_modules/fit-file-parser/dist/cjs/helper.js:8:13)
47
+
48
+ console.log
49
+ [DEBUG] Promise resolved
50
+
51
+ at log (src/specs/activities-parsing.integration.spec.ts:126:19)
52
+
53
+ console.error
54
+ [DEBUG] Expectation failed Error: Actual time of "57:53" (or 3473s) IS HIGHER THAN "44:06". Max possible value: "44:19" (or 2659.23s); Delta seconds: 13.23
55
+ at Function.assertNearEqualTime (/Users/dimitrios/Projects/sports-lib/src/specs/spec-utils.ts:161:15)
56
+ at assertNearEqualTime (/Users/dimitrios/Projects/sports-lib/src/specs/activities-parsing.integration.spec.ts:165:23)
57
+
58
+ 171 | done();
59
+ 172 | } catch (e) {
60
+ > 173 | console.error('[DEBUG] Expectation failed', e);
61
+ | ^
62
+ 174 | done(e);
63
+ 175 | }
64
+ 176 | }).catch((e) => {
65
+
66
+ at error (src/specs/activities-parsing.integration.spec.ts:173:21)
67
+
68
+ FAIL src/specs/activities-parsing.integration.spec.ts
69
+ FIT/TCX/GPX activity parsing compliance
70
+ Swimming
71
+ FIT
72
+ ✕ should parse swimming pool FIT file (1) (144 ms)
73
+ ○ skipped should parse swimming pool FIT file (2)
74
+ ○ skipped should parse swimming pool FIT file (3)
75
+ ○ skipped should parse swimming pool FIT file (4)
76
+ ○ skipped should parse swimming open water FIT file (1)
77
+ TCX
78
+ ○ skipped should parse swimming pool TCX file (1)
79
+ ○ skipped should parse swimming pool TCX file (2)
80
+ GPX
81
+ ○ skipped should parse swimming open water GPX file (1)
82
+ ○ skipped should parse swimming open water GPX file (2)
83
+ Running
84
+ FIT
85
+ ○ skipped should parse running FIT file (1)
86
+ ○ skipped should parse running FIT file (2)
87
+ ○ skipped should parse running FIT file (Suunto export) (3)
88
+ ○ skipped should parse running FIT file (Suunto export) (4)
89
+ ○ skipped should parse running FIT file (Suunto export) (5)
90
+ ○ skipped should parse running FIT file (Suunto export) (6)
91
+ ○ skipped should parse running FIT file (Coros export) (7)
92
+ ○ skipped should parse running FIT file (Coros export) (8)
93
+ ○ skipped should parse running treadmill FIT file (1)
94
+ TCX
95
+ ○ skipped should parse running TCX file (1)
96
+ ○ skipped should parse running TCX file (2)
97
+ ○ skipped should parse running TCX file (3)
98
+ ○ skipped should parse running TCX file (4)
99
+ ○ skipped should parse running treadmill TCX file (3)
100
+ GPX
101
+ ○ skipped should parse running GPX file (1)
102
+ ○ skipped should parse running GPX file (2)
103
+ ○ skipped should parse running GPX file (3)
104
+ ○ skipped should parse running GPX file (4)
105
+ ○ skipped should parse running GPX file (5)
106
+ ○ skipped should parse running GPX file (6)
107
+ Cycling
108
+ FIT
109
+ ○ skipped should parse cycling FIT file (1)
110
+ ○ skipped should parse cycling FIT file (2)
111
+ ○ skipped should parse cycling FIT file (3)
112
+ ○ skipped should parse cycling FIT file (4)
113
+ ○ skipped should parse cycling FIT file (5)
114
+ ○ skipped should parse cycling FIT file (6)
115
+ ○ skipped should parse cycling FIT file (7)
116
+ ○ skipped should parse cycling FIT file (8)
117
+ ○ skipped should parse cycling FIT file (9)
118
+ ○ skipped should parse virtual cycling FIT file (1)
119
+ TCX
120
+ ○ skipped should parse cycling TCX file (1)
121
+ ○ skipped should parse cycling TCX file (2)
122
+ ○ skipped should parse cycling TCX file (3)
123
+ ○ skipped should parse virtual cycling TCX file (1)
124
+ GPX
125
+ ○ skipped should parse cycling GPX file (1)
126
+ ○ skipped should parse cycling GPX file (2)
127
+ ○ skipped should parse cycling GPX file (3)
128
+ ○ skipped should parse cycling GPX file (4)
129
+ ○ skipped should parse virtual cycling GPX file (1)
130
+ Triathlon
131
+ FIT
132
+ ○ skipped should parse a .FIT Triathlon IronMan w/ 3 activities (swim + ride + run)
133
+ Others
134
+ ○ skipped should reject parsing of broken fit file (empty activities)
135
+ ○ skipped should reject parsing of broken fit file (empty sessions)
136
+ ○ skipped should parse fit file with broken sessionObject.start_time date
137
+ ○ skipped should handle activity with broken start lat/lng
138
+ ○ skipped should reject parsing of a too long activity (31 days)
139
+ ○ skipped should handle inverted elapsed and timer time
140
+ ○ skipped should handle calculation on a ultra long activity (27 days) with acceptable human time
141
+ ○ skipped should handle and detect an activity with broken speed data
142
+
143
+ ● FIT/TCX/GPX activity parsing compliance › Swimming › FIT › should parse swimming pool FIT file (1)
144
+
145
+ Actual time of "57:53" (or 3473s) IS HIGHER THAN "44:06". Max possible value: "44:19" (or 2659.23s); Delta seconds: 13.23
146
+
147
+ 159 |
148
+ 160 | if (SpecUtils.THROW_ON_ERROR) {
149
+ > 161 | throw new Error(message);
150
+ | ^
151
+ 162 | } else {
152
+ 163 | console.error(message);
153
+ 164 | }
154
+
155
+ at Function.assertNearEqualTime (src/specs/spec-utils.ts:161:15)
156
+ at assertNearEqualTime (src/specs/activities-parsing.integration.spec.ts:165:23)
157
+
158
+ Test Suites: 1 failed, 1 total
159
+ Tests: 1 failed, 56 skipped, 57 total
160
+ Snapshots: 0 total
161
+ Time: 2.155 s, estimated 6 s
162
+ Ran all test suites matching src/specs/activities-parsing.integration.spec.ts.
@@ -0,0 +1,168 @@
1
+ ts-jest[ts-jest-transformer] (WARN) Define `ts-jest` config under `globals` is deprecated. Please do
2
+ transform: {
3
+ <transform_regex>: ['ts-jest', { /* ts-jest config goes here in Jest */ }],
4
+ },
5
+ See more at https://kulshekhar.github.io/ts-jest/docs/getting-started/presets#advanced
6
+ console.log
7
+ Jest Setup: Enabled ActivityParsingOptions.generateUnitStreams.
8
+
9
+ at Object.log (jest.setup.ts:8:9)
10
+
11
+ [DEBUG-FORCE] fit-parser.js LOADING via process.stdout
12
+ console.error
13
+ [DEBUG-FORCE] fit-parser.js LOADING via console.error
14
+
15
+ 111 | // eslint-disable-next-line @typescript-eslint/no-var-requires
16
+ 112 | // @ts-ignore
17
+ > 113 | import FitFileParser from 'fit-file-parser';
18
+ | ^
19
+ 114 | try {
20
+ 115 | console.log('[DEBUG-JEST-RESOLVE] fit-file-parser resolves to:', require.resolve('fit-file-parser'));
21
+ 116 | } catch (e) {
22
+
23
+ at Object.error (node_modules/fit-file-parser/dist/cjs/fit-parser.js:6:9)
24
+ at Object.require (src/events/adapters/importers/fit/importer.fit.ts:113:1)
25
+ at Object.require (src/index.ts:4:1)
26
+ at Object.require (src/specs/activities-parsing.integration.spec.ts:2:1)
27
+
28
+ console.log
29
+ [DEBUG-JEST-RESOLVE] fit-file-parser resolves to: /Users/dimitrios/Projects/sports-lib/node_modules/fit-file-parser/dist/cjs/fit-parser.js
30
+
31
+ at Object.log (src/events/adapters/importers/fit/importer.fit.ts:115:11)
32
+
33
+ console.log
34
+ [DEBUG] Start parsing FIT file (1)
35
+
36
+ at Object.log (src/specs/activities-parsing.integration.spec.ts:119:17)
37
+
38
+ console.log
39
+ [DEBUG-FIT-PARSER] CJS helper.js LOADED - Patched Version
40
+
41
+ at log (node_modules/fit-file-parser/dist/cjs/helper.js:8:13)
42
+
43
+ console.log
44
+ [DEBUG-FIT-PARSER] CJS helper.js LOADED - Patched Version
45
+
46
+ at log (node_modules/fit-file-parser/dist/cjs/helper.js:8:13)
47
+
48
+ console.log
49
+ [DEBUG-IMPORTER] Found top-level lengths: 64
50
+
51
+ at log (src/events/adapters/importers/fit/importer.fit.ts:333:19)
52
+
53
+ console.log
54
+ [DEBUG] Promise resolved
55
+
56
+ at log (src/specs/activities-parsing.integration.spec.ts:126:19)
57
+
58
+ console.error
59
+ [DEBUG] Expectation failed Error: Actual time of "57:53" (or 3473s) IS HIGHER THAN "44:06". Max possible value: "44:19" (or 2659.23s); Delta seconds: 13.23
60
+ at Function.assertNearEqualTime (/Users/dimitrios/Projects/sports-lib/src/specs/spec-utils.ts:161:15)
61
+ at assertNearEqualTime (/Users/dimitrios/Projects/sports-lib/src/specs/activities-parsing.integration.spec.ts:165:23)
62
+ at processTicksAndRejections (node:internal/process/task_queues:95:5)
63
+
64
+ 171 | done();
65
+ 172 | } catch (e) {
66
+ > 173 | console.error('[DEBUG] Expectation failed', e);
67
+ | ^
68
+ 174 | done(e);
69
+ 175 | }
70
+ 176 | }).catch((e) => {
71
+
72
+ at error (src/specs/activities-parsing.integration.spec.ts:173:21)
73
+
74
+ FAIL src/specs/activities-parsing.integration.spec.ts
75
+ FIT/TCX/GPX activity parsing compliance
76
+ Swimming
77
+ FIT
78
+ ✕ should parse swimming pool FIT file (1) (140 ms)
79
+ ○ skipped should parse swimming pool FIT file (2)
80
+ ○ skipped should parse swimming pool FIT file (3)
81
+ ○ skipped should parse swimming pool FIT file (4)
82
+ ○ skipped should parse swimming open water FIT file (1)
83
+ TCX
84
+ ○ skipped should parse swimming pool TCX file (1)
85
+ ○ skipped should parse swimming pool TCX file (2)
86
+ GPX
87
+ ○ skipped should parse swimming open water GPX file (1)
88
+ ○ skipped should parse swimming open water GPX file (2)
89
+ Running
90
+ FIT
91
+ ○ skipped should parse running FIT file (1)
92
+ ○ skipped should parse running FIT file (2)
93
+ ○ skipped should parse running FIT file (Suunto export) (3)
94
+ ○ skipped should parse running FIT file (Suunto export) (4)
95
+ ○ skipped should parse running FIT file (Suunto export) (5)
96
+ ○ skipped should parse running FIT file (Suunto export) (6)
97
+ ○ skipped should parse running FIT file (Coros export) (7)
98
+ ○ skipped should parse running FIT file (Coros export) (8)
99
+ ○ skipped should parse running treadmill FIT file (1)
100
+ TCX
101
+ ○ skipped should parse running TCX file (1)
102
+ ○ skipped should parse running TCX file (2)
103
+ ○ skipped should parse running TCX file (3)
104
+ ○ skipped should parse running TCX file (4)
105
+ ○ skipped should parse running treadmill TCX file (3)
106
+ GPX
107
+ ○ skipped should parse running GPX file (1)
108
+ ○ skipped should parse running GPX file (2)
109
+ ○ skipped should parse running GPX file (3)
110
+ ○ skipped should parse running GPX file (4)
111
+ ○ skipped should parse running GPX file (5)
112
+ ○ skipped should parse running GPX file (6)
113
+ Cycling
114
+ FIT
115
+ ○ skipped should parse cycling FIT file (1)
116
+ ○ skipped should parse cycling FIT file (2)
117
+ ○ skipped should parse cycling FIT file (3)
118
+ ○ skipped should parse cycling FIT file (4)
119
+ ○ skipped should parse cycling FIT file (5)
120
+ ○ skipped should parse cycling FIT file (6)
121
+ ○ skipped should parse cycling FIT file (7)
122
+ ○ skipped should parse cycling FIT file (8)
123
+ ○ skipped should parse cycling FIT file (9)
124
+ ○ skipped should parse virtual cycling FIT file (1)
125
+ TCX
126
+ ○ skipped should parse cycling TCX file (1)
127
+ ○ skipped should parse cycling TCX file (2)
128
+ ○ skipped should parse cycling TCX file (3)
129
+ ○ skipped should parse virtual cycling TCX file (1)
130
+ GPX
131
+ ○ skipped should parse cycling GPX file (1)
132
+ ○ skipped should parse cycling GPX file (2)
133
+ ○ skipped should parse cycling GPX file (3)
134
+ ○ skipped should parse cycling GPX file (4)
135
+ ○ skipped should parse virtual cycling GPX file (1)
136
+ Triathlon
137
+ FIT
138
+ ○ skipped should parse a .FIT Triathlon IronMan w/ 3 activities (swim + ride + run)
139
+ Others
140
+ ○ skipped should reject parsing of broken fit file (empty activities)
141
+ ○ skipped should reject parsing of broken fit file (empty sessions)
142
+ ○ skipped should parse fit file with broken sessionObject.start_time date
143
+ ○ skipped should handle activity with broken start lat/lng
144
+ ○ skipped should reject parsing of a too long activity (31 days)
145
+ ○ skipped should handle inverted elapsed and timer time
146
+ ○ skipped should handle calculation on a ultra long activity (27 days) with acceptable human time
147
+ ○ skipped should handle and detect an activity with broken speed data
148
+
149
+ ● FIT/TCX/GPX activity parsing compliance › Swimming › FIT › should parse swimming pool FIT file (1)
150
+
151
+ Actual time of "57:53" (or 3473s) IS HIGHER THAN "44:06". Max possible value: "44:19" (or 2659.23s); Delta seconds: 13.23
152
+
153
+ 159 |
154
+ 160 | if (SpecUtils.THROW_ON_ERROR) {
155
+ > 161 | throw new Error(message);
156
+ | ^
157
+ 162 | } else {
158
+ 163 | console.error(message);
159
+ 164 | }
160
+
161
+ at Function.assertNearEqualTime (src/specs/spec-utils.ts:161:15)
162
+ at assertNearEqualTime (src/specs/activities-parsing.integration.spec.ts:165:23)
163
+
164
+ Test Suites: 1 failed, 1 total
165
+ Tests: 1 failed, 56 skipped, 57 total
166
+ Snapshots: 0 total
167
+ Time: 2.952 s, estimated 3 s
168
+ Ran all test suites matching src/specs/activities-parsing.integration.spec.ts.
@@ -0,0 +1,168 @@
1
+ ts-jest[ts-jest-transformer] (WARN) Define `ts-jest` config under `globals` is deprecated. Please do
2
+ transform: {
3
+ <transform_regex>: ['ts-jest', { /* ts-jest config goes here in Jest */ }],
4
+ },
5
+ See more at https://kulshekhar.github.io/ts-jest/docs/getting-started/presets#advanced
6
+ console.log
7
+ Jest Setup: Enabled ActivityParsingOptions.generateUnitStreams.
8
+
9
+ at Object.log (jest.setup.ts:8:9)
10
+
11
+ [DEBUG-FORCE] fit-parser.js LOADING via process.stdout
12
+ console.error
13
+ [DEBUG-FORCE] fit-parser.js LOADING via console.error
14
+
15
+ 111 | // eslint-disable-next-line @typescript-eslint/no-var-requires
16
+ 112 | // @ts-ignore
17
+ > 113 | import FitFileParser from 'fit-file-parser';
18
+ | ^
19
+ 114 | try {
20
+ 115 | console.log('[DEBUG-JEST-RESOLVE] fit-file-parser resolves to:', require.resolve('fit-file-parser'));
21
+ 116 | } catch (e) {
22
+
23
+ at Object.error (node_modules/fit-file-parser/dist/cjs/fit-parser.js:6:9)
24
+ at Object.require (src/events/adapters/importers/fit/importer.fit.ts:113:1)
25
+ at Object.require (src/index.ts:4:1)
26
+ at Object.require (src/specs/activities-parsing.integration.spec.ts:2:1)
27
+
28
+ console.log
29
+ [DEBUG-JEST-RESOLVE] fit-file-parser resolves to: /Users/dimitrios/Projects/sports-lib/node_modules/fit-file-parser/dist/cjs/fit-parser.js
30
+
31
+ at Object.log (src/events/adapters/importers/fit/importer.fit.ts:115:11)
32
+
33
+ console.log
34
+ [DEBUG] Start parsing FIT file (1)
35
+
36
+ at Object.log (src/specs/activities-parsing.integration.spec.ts:119:17)
37
+
38
+ console.log
39
+ [DEBUG-FIT-PARSER] CJS helper.js LOADED - Patched Version
40
+
41
+ at log (node_modules/fit-file-parser/dist/cjs/helper.js:8:13)
42
+
43
+ console.log
44
+ [DEBUG-FIT-PARSER] CJS helper.js LOADED - Patched Version
45
+
46
+ at log (node_modules/fit-file-parser/dist/cjs/helper.js:8:13)
47
+
48
+ console.log
49
+ [DEBUG-IMPORTER] Found top-level lengths: 64
50
+
51
+ at log (src/events/adapters/importers/fit/importer.fit.ts:333:19)
52
+
53
+ console.log
54
+ [DEBUG] Promise resolved
55
+
56
+ at log (src/specs/activities-parsing.integration.spec.ts:126:19)
57
+
58
+ console.error
59
+ [DEBUG] Expectation failed Error: Actual time of "57:53" (or 3473s) IS HIGHER THAN "44:06". Max possible value: "44:19" (or 2659.23s); Delta seconds: 13.23
60
+ at Function.assertNearEqualTime (/Users/dimitrios/Projects/sports-lib/src/specs/spec-utils.ts:161:15)
61
+ at assertNearEqualTime (/Users/dimitrios/Projects/sports-lib/src/specs/activities-parsing.integration.spec.ts:165:23)
62
+ at processTicksAndRejections (node:internal/process/task_queues:95:5)
63
+
64
+ 171 | done();
65
+ 172 | } catch (e) {
66
+ > 173 | console.error('[DEBUG] Expectation failed', e);
67
+ | ^
68
+ 174 | done(e);
69
+ 175 | }
70
+ 176 | }).catch((e) => {
71
+
72
+ at error (src/specs/activities-parsing.integration.spec.ts:173:21)
73
+
74
+ FAIL src/specs/activities-parsing.integration.spec.ts (5.449 s)
75
+ FIT/TCX/GPX activity parsing compliance
76
+ Swimming
77
+ FIT
78
+ ✕ should parse swimming pool FIT file (1) (135 ms)
79
+ ○ skipped should parse swimming pool FIT file (2)
80
+ ○ skipped should parse swimming pool FIT file (3)
81
+ ○ skipped should parse swimming pool FIT file (4)
82
+ ○ skipped should parse swimming open water FIT file (1)
83
+ TCX
84
+ ○ skipped should parse swimming pool TCX file (1)
85
+ ○ skipped should parse swimming pool TCX file (2)
86
+ GPX
87
+ ○ skipped should parse swimming open water GPX file (1)
88
+ ○ skipped should parse swimming open water GPX file (2)
89
+ Running
90
+ FIT
91
+ ○ skipped should parse running FIT file (1)
92
+ ○ skipped should parse running FIT file (2)
93
+ ○ skipped should parse running FIT file (Suunto export) (3)
94
+ ○ skipped should parse running FIT file (Suunto export) (4)
95
+ ○ skipped should parse running FIT file (Suunto export) (5)
96
+ ○ skipped should parse running FIT file (Suunto export) (6)
97
+ ○ skipped should parse running FIT file (Coros export) (7)
98
+ ○ skipped should parse running FIT file (Coros export) (8)
99
+ ○ skipped should parse running treadmill FIT file (1)
100
+ TCX
101
+ ○ skipped should parse running TCX file (1)
102
+ ○ skipped should parse running TCX file (2)
103
+ ○ skipped should parse running TCX file (3)
104
+ ○ skipped should parse running TCX file (4)
105
+ ○ skipped should parse running treadmill TCX file (3)
106
+ GPX
107
+ ○ skipped should parse running GPX file (1)
108
+ ○ skipped should parse running GPX file (2)
109
+ ○ skipped should parse running GPX file (3)
110
+ ○ skipped should parse running GPX file (4)
111
+ ○ skipped should parse running GPX file (5)
112
+ ○ skipped should parse running GPX file (6)
113
+ Cycling
114
+ FIT
115
+ ○ skipped should parse cycling FIT file (1)
116
+ ○ skipped should parse cycling FIT file (2)
117
+ ○ skipped should parse cycling FIT file (3)
118
+ ○ skipped should parse cycling FIT file (4)
119
+ ○ skipped should parse cycling FIT file (5)
120
+ ○ skipped should parse cycling FIT file (6)
121
+ ○ skipped should parse cycling FIT file (7)
122
+ ○ skipped should parse cycling FIT file (8)
123
+ ○ skipped should parse cycling FIT file (9)
124
+ ○ skipped should parse virtual cycling FIT file (1)
125
+ TCX
126
+ ○ skipped should parse cycling TCX file (1)
127
+ ○ skipped should parse cycling TCX file (2)
128
+ ○ skipped should parse cycling TCX file (3)
129
+ ○ skipped should parse virtual cycling TCX file (1)
130
+ GPX
131
+ ○ skipped should parse cycling GPX file (1)
132
+ ○ skipped should parse cycling GPX file (2)
133
+ ○ skipped should parse cycling GPX file (3)
134
+ ○ skipped should parse cycling GPX file (4)
135
+ ○ skipped should parse virtual cycling GPX file (1)
136
+ Triathlon
137
+ FIT
138
+ ○ skipped should parse a .FIT Triathlon IronMan w/ 3 activities (swim + ride + run)
139
+ Others
140
+ ○ skipped should reject parsing of broken fit file (empty activities)
141
+ ○ skipped should reject parsing of broken fit file (empty sessions)
142
+ ○ skipped should parse fit file with broken sessionObject.start_time date
143
+ ○ skipped should handle activity with broken start lat/lng
144
+ ○ skipped should reject parsing of a too long activity (31 days)
145
+ ○ skipped should handle inverted elapsed and timer time
146
+ ○ skipped should handle calculation on a ultra long activity (27 days) with acceptable human time
147
+ ○ skipped should handle and detect an activity with broken speed data
148
+
149
+ ● FIT/TCX/GPX activity parsing compliance › Swimming › FIT › should parse swimming pool FIT file (1)
150
+
151
+ Actual time of "57:53" (or 3473s) IS HIGHER THAN "44:06". Max possible value: "44:19" (or 2659.23s); Delta seconds: 13.23
152
+
153
+ 159 |
154
+ 160 | if (SpecUtils.THROW_ON_ERROR) {
155
+ > 161 | throw new Error(message);
156
+ | ^
157
+ 162 | } else {
158
+ 163 | console.error(message);
159
+ 164 | }
160
+
161
+ at Function.assertNearEqualTime (src/specs/spec-utils.ts:161:15)
162
+ at assertNearEqualTime (src/specs/activities-parsing.integration.spec.ts:165:23)
163
+
164
+ Test Suites: 1 failed, 1 total
165
+ Tests: 1 failed, 56 skipped, 57 total
166
+ Snapshots: 0 total
167
+ Time: 5.616 s
168
+ Ran all test suites matching src/specs/activities-parsing.integration.spec.ts.
@@ -1,60 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
- return new (P || (P = Promise))(function (resolve, reject) {
24
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
- step((generator = generator.apply(thisArg, _arguments || [])).next());
28
- });
29
- };
30
- Object.defineProperty(exports, "__esModule", { value: true });
31
- const fs = __importStar(require("fs"));
32
- const path = __importStar(require("path"));
33
- const importer_fit_1 = require("./importer.fit");
34
- describe('EventImporterFIT OOM Reproduction', () => {
35
- const oomSamplesDir = path.resolve(__dirname, '../../../../../samples/fit/oom');
36
- it('should parse OOM sample fit files', () => __awaiter(void 0, void 0, void 0, function* () {
37
- if (!fs.existsSync(oomSamplesDir)) {
38
- console.warn(`OOM Samples directory not found at ${oomSamplesDir}. Skipping reproduction.`);
39
- return;
40
- }
41
- const files = fs.readdirSync(oomSamplesDir).filter(f => f.endsWith('.fit'));
42
- for (const file of files) {
43
- console.log(`>>> START Processing ${file}`);
44
- const filePath = path.join(oomSamplesDir, file);
45
- const fileBuffer = fs.readFileSync(filePath);
46
- const arrayBuffer = fileBuffer.buffer.slice(fileBuffer.byteOffset, fileBuffer.byteOffset + fileBuffer.byteLength);
47
- console.log(`Testing file: ${file} (${fileBuffer.length} bytes)`);
48
- try {
49
- const event = yield importer_fit_1.EventImporterFIT.getFromArrayBuffer(arrayBuffer, undefined, file);
50
- expect(event).toBeDefined();
51
- console.log(`✅ Successfully parsed ${file}`);
52
- }
53
- catch (error) {
54
- console.error(`❌ Failed to parse ${file}:`, error);
55
- // We don't necessarily want to throw here if we want to test all files
56
- }
57
- console.log(`<<< END Processing ${file}`);
58
- }
59
- }), 100000); // 100s timeout as these might take time if they are huge
60
- });
@@ -1,39 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import * as fs from 'fs';
11
- import * as path from 'path';
12
- import { EventImporterFIT } from './importer.fit';
13
- describe('EventImporterFIT OOM Reproduction', () => {
14
- const oomSamplesDir = path.resolve(__dirname, '../../../../../samples/fit/oom');
15
- it('should parse OOM sample fit files', () => __awaiter(void 0, void 0, void 0, function* () {
16
- if (!fs.existsSync(oomSamplesDir)) {
17
- console.warn(`OOM Samples directory not found at ${oomSamplesDir}. Skipping reproduction.`);
18
- return;
19
- }
20
- const files = fs.readdirSync(oomSamplesDir).filter(f => f.endsWith('.fit'));
21
- for (const file of files) {
22
- console.log(`>>> START Processing ${file}`);
23
- const filePath = path.join(oomSamplesDir, file);
24
- const fileBuffer = fs.readFileSync(filePath);
25
- const arrayBuffer = fileBuffer.buffer.slice(fileBuffer.byteOffset, fileBuffer.byteOffset + fileBuffer.byteLength);
26
- console.log(`Testing file: ${file} (${fileBuffer.length} bytes)`);
27
- try {
28
- const event = yield EventImporterFIT.getFromArrayBuffer(arrayBuffer, undefined, file);
29
- expect(event).toBeDefined();
30
- console.log(`✅ Successfully parsed ${file}`);
31
- }
32
- catch (error) {
33
- console.error(`❌ Failed to parse ${file}:`, error);
34
- // We don't necessarily want to throw here if we want to test all files
35
- }
36
- console.log(`<<< END Processing ${file}`);
37
- }
38
- }), 100000); // 100s timeout as these might take time if they are huge
39
- });
package/reproduce_oom.ts DELETED
@@ -1,35 +0,0 @@
1
- import * as fs from 'fs';
2
- import * as path from 'path';
3
- import { EventImporterFIT } from './src/events/adapters/importers/fit/importer.fit';
4
-
5
- async function reproduce() {
6
- const oomSamplesDir = path.resolve(__dirname, 'samples/fit/oom');
7
-
8
- if (!fs.existsSync(oomSamplesDir)) {
9
- console.warn(`OOM Samples directory not found at ${oomSamplesDir}.`);
10
- return;
11
- }
12
-
13
- const files = fs.readdirSync(oomSamplesDir).filter(f => f.endsWith('.fit'));
14
-
15
- for (const file of files) {
16
- process.stdout.write(`>>> START Processing ${file}\n`);
17
- const filePath = path.join(oomSamplesDir, file);
18
- const fileBuffer = fs.readFileSync(filePath);
19
- const arrayBuffer = fileBuffer.buffer.slice(fileBuffer.byteOffset, fileBuffer.byteOffset + fileBuffer.byteLength);
20
-
21
- console.log(`Testing file: ${file} (${fileBuffer.length} bytes)`);
22
- try {
23
- const event = await EventImporterFIT.getFromArrayBuffer(arrayBuffer, undefined, file);
24
- console.log(`✅ Successfully parsed ${file}`);
25
- } catch (error) {
26
- console.error(`❌ Failed to parse ${file}:`, error);
27
- }
28
- process.stdout.write(`<<< END Processing ${file}\n`);
29
- }
30
- }
31
-
32
- reproduce().catch(err => {
33
- console.error('FATAL ERROR:', err);
34
- process.exit(1);
35
- });