countly-sdk-web 23.12.0 → 23.12.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 23.12.1
2
+ - Added methods for bridged SDK usage
3
+
1
4
  ## 23.12.0
2
5
  - You can now provide custom storage methods to the SDK
3
6
  - You can now use the SDK in web workers
@@ -0,0 +1,45 @@
1
+ /* eslint-disable cypress/no-unnecessary-waiting */
2
+ /* eslint-disable require-jsdoc */
3
+ var Countly = require("../../lib/countly");
4
+ // import * as Countly from "../../dist/countly_umd.js";
5
+ var hp = require("../support/helper.js");
6
+
7
+ function initMain(name, version) {
8
+ Countly.init({
9
+ app_key: "YOUR_APP_KEY",
10
+ url: "https://your.domain.count.ly",
11
+ test_mode: true,
12
+ debug: true,
13
+ sdk_name: name,
14
+ sdk_version: version
15
+ });
16
+ }
17
+
18
+ const SDK_NAME = "javascript_native_web";
19
+ const SDK_VERSION = "23.12.1";
20
+
21
+ // tests
22
+ describe("Bridged SDK Utilities Tests", () => {
23
+ it("Check if we can override sdk name and version successful", () => {
24
+ hp.haltAndClearStorage(() => {
25
+ initMain("javascript_gtm_web", "24.0.0");
26
+ hp.events();
27
+ cy.fetch_local_request_queue().then((eq) => {
28
+ expect(eq).to.have.length(1);
29
+ expect(eq[0].sdk_name).to.equal("javascript_gtm_web");
30
+ expect(eq[0].sdk_version).to.equal("24.0.0");
31
+ });
32
+ });
33
+ });
34
+ it("Check if SDK uses default values if SDK name and version was not overriden", () => {
35
+ hp.haltAndClearStorage(() => {
36
+ initMain(undefined, undefined);
37
+ hp.events();
38
+ cy.fetch_local_request_queue().then((eq) => {
39
+ expect(eq).to.have.length(1);
40
+ expect(eq[0].sdk_name).to.equal(SDK_NAME);
41
+ expect(eq[0].sdk_version).to.equal(SDK_VERSION);
42
+ });
43
+ });
44
+ });
45
+ });