@microsoft/applicationinsights-analytics-js 2.7.2-nightly.2111-08 → 2.7.2-nightly.2111-09
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/Tests/Unit/src/AnalyticsExtensionSize.tests.ts +58 -0
- package/Tests/Unit/src/ApplicationInsights.tests.ts +1647 -0
- package/Tests/Unit/src/TelemetryItemCreator.tests.ts +304 -0
- package/Tests/Unit/src/appinsights-analytics.tests.ts +9 -0
- package/Tests/UnitTests.html +62 -0
- package/Tests/tsconfig.json +13 -0
- package/api-extractor.json +361 -0
- package/applicationinsights-analytics-js.build.error.log +80 -0
- package/applicationinsights-analytics-js.build.log +309 -0
- package/browser/applicationinsights-analytics-js.integrity.json +9 -9
- package/browser/applicationinsights-analytics-js.js +2 -2
- package/browser/applicationinsights-analytics-js.js.map +1 -1
- package/browser/applicationinsights-analytics-js.min.js +2 -2
- package/browser/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist/applicationinsights-analytics-js.api.json +1 -1
- package/dist/applicationinsights-analytics-js.d.ts +1 -1
- package/dist/applicationinsights-analytics-js.js +2 -2
- package/dist/applicationinsights-analytics-js.js.map +1 -1
- package/dist/applicationinsights-analytics-js.min.js +2 -2
- package/dist/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist/applicationinsights-analytics-js.rollup.d.ts +1 -1
- package/dist-esm/JavaScriptSDK/ApplicationInsights.js +2 -2
- package/dist-esm/JavaScriptSDK/ApplicationInsights.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryConfig.js +1 -1
- package/dist-esm/applicationinsights-analytics-js.js +1 -1
- package/microsoft-applicationinsights-analytics-js-2.7.2-nightly.2111-09.tgz +0 -0
- package/package.json +5 -5
- package/rollup.config.js +139 -0
- package/src/JavaScriptSDK/ApplicationInsights.ts +1 -1
- package/temp/applicationinsights-analytics-js.api.md +114 -0
- package/tslint.json +5 -0
- package/types/tsdoc-metadata.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Assert, AITestClass } from "@microsoft/ai-test-framework";
|
|
2
|
+
import * as pako from "pako";
|
|
3
|
+
|
|
4
|
+
export class AnalyticsExtensionSizeCheck extends AITestClass {
|
|
5
|
+
private readonly MAX_DEFLATE_SIZE = 20;
|
|
6
|
+
private readonly rawFilePath = "../dist/applicationinsights-analytics-js.min.js";
|
|
7
|
+
private readonly prodFilePaath = "../browser/applicationinsights-analytics-js.min.js"
|
|
8
|
+
|
|
9
|
+
public testInitialize() {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public testCleanup() {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public registerTests() {
|
|
16
|
+
this.addRawFileSizeCheck();
|
|
17
|
+
this.addProdFileSizeCheck();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
constructor() {
|
|
21
|
+
super("AnalyticsExtensionSizeCheck");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private addRawFileSizeCheck(): void {
|
|
25
|
+
this._fileSizeCheck(false);
|
|
26
|
+
}
|
|
27
|
+
private addProdFileSizeCheck(): void {
|
|
28
|
+
this._fileSizeCheck(true);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private _fileSizeCheck(isProd: boolean): void {
|
|
32
|
+
let _filePath = isProd? this.prodFilePaath : this.rawFilePath;
|
|
33
|
+
let postfix = isProd? "" : "-raw";
|
|
34
|
+
let fileName = _filePath.split("..")[1];
|
|
35
|
+
this.testCase({
|
|
36
|
+
name: `Test applicationinsights-analytics-extension${postfix} deflate size`,
|
|
37
|
+
test: () => {
|
|
38
|
+
Assert.ok(true, `test file: ${fileName}`);
|
|
39
|
+
let request = new Request(_filePath, {method:"GET"});
|
|
40
|
+
return fetch(request).then((response) => {
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
Assert.ok(false, `fetch applicationinsights-analytics${postfix} error: ${response.statusText}`);
|
|
43
|
+
return;
|
|
44
|
+
} else {
|
|
45
|
+
return response.text().then(text => {
|
|
46
|
+
let size = Math.ceil(pako.deflate(text).length/1024);
|
|
47
|
+
Assert.ok(size <= this.MAX_DEFLATE_SIZE ,`max ${this.MAX_DEFLATE_SIZE} KB, current deflate size is: ${size} KB`);
|
|
48
|
+
}).catch((error) => {
|
|
49
|
+
Assert.ok(false, `applicationinsights-analytics-extension${postfix} response error: ${error}`);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}).catch((error: Error) => {
|
|
53
|
+
Assert.ok(false, `applicationinsights-analytics-extension${postfix} deflate size error: ${error}`);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|