Skip to content

Commit e87a9cc

Browse files
committed
chore: fix unit tests and update nativescript-preview-sdk
1 parent 68a3ff3 commit e87a9cc

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

lib/services/livesync/playground/preview-app-livesync-service.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as path from "path";
22
import { Device, FilesPayload } from "nativescript-preview-sdk";
3-
import { AnalyticsEventLabelDelimiter, APP_RESOURCES_FOLDER_NAME, APP_FOLDER_NAME, TrackActionNames } from "../../../constants";
3+
import { APP_RESOURCES_FOLDER_NAME, APP_FOLDER_NAME, TrackActionNames } from "../../../constants";
44
import { PreviewAppLiveSyncEvents } from "./preview-app-constants";
55
import { HmrConstants } from "../../../common/constants";
66
import { stringify } from "../../../common/helpers";
@@ -34,12 +34,11 @@ export class PreviewAppLiveSyncService extends EventEmitter implements IPreviewA
3434
this.$errors.failWithoutHelp("Sending initial preview files without a specified device is not supported.");
3535
}
3636

37-
const deviceUniqueId = (<any>device).uniqueId;
38-
if (deviceUniqueId) {
39-
this.$analyticsService.trackEventActionInGoogleAnalytics({
37+
if (device.uniqueId) {
38+
await this.$analyticsService.trackEventActionInGoogleAnalytics({
4039
action: TrackActionNames.PreviewAppData,
4140
platform: device.platform,
42-
additionalData: `previewAppDeviceId${AnalyticsEventLabelDelimiter}${deviceUniqueId}`
41+
additionalData: device.uniqueId
4342
});
4443
}
4544

npm-shrinkwrap.json

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"mkdirp": "0.5.1",
5959
"mute-stream": "0.0.5",
6060
"nativescript-doctor": "1.8.1",
61-
"nativescript-preview-sdk": "0.3.2",
61+
"nativescript-preview-sdk": "0.3.3",
6262
"open": "0.0.5",
6363
"ora": "2.0.0",
6464
"osenv": "0.1.3",

test/services/playground/preview-app-plugins-service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ function createDevice(plugins: string): Device {
5959
previewAppVersion: "28.0.0",
6060
runtimeVersion: "4.3.0",
6161
plugins,
62-
pluginsExpanded: false
62+
pluginsExpanded: false,
63+
uniqueId: "testId"
6364
};
6465
}
6566

test/services/preview-devices-service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ function createDevice(id: string): Device {
2929
name: "my test name",
3030
osVersion: "10.0.0",
3131
previewAppVersion: "19.0.0",
32-
runtimeVersion: "5.0.0"
32+
runtimeVersion: "5.0.0",
33+
uniqueId: "testUniqueId"
3334
};
3435
}
3536

0 commit comments

Comments
 (0)