Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AISKU/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"grunt": "^1.5.3",
"grunt-cli": "^1.4.3",
"@nevware21/ts-async": ">= 0.5.5 < 2.x",
"@nevware21/grunt-ts-plugin": "^0.4.3",
"@nevware21/grunt-eslint-ts": "^0.2.2",
"@nevware21/grunt-ts-plugin": "^0.5.1",
"@nevware21/grunt-eslint-ts": "^0.5.1",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"pako": "^2.0.3",
Expand Down
4 changes: 2 additions & 2 deletions AISKULight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"@microsoft/api-extractor": "^7.40.0",
"grunt": "^1.5.3",
"grunt-cli": "^1.4.3",
"@nevware21/grunt-ts-plugin": "^0.4.3",
"@nevware21/grunt-eslint-ts": "^0.2.2",
"@nevware21/grunt-ts-plugin": "^0.5.1",
"@nevware21/grunt-eslint-ts": "^0.5.1",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"pako": "^2.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,97 @@ export class SenderTests extends AITestClass {
}
});

this.testCase({
name: "zip test: gzip encode is working and content-encode header is set (feature opt-in)",
pollDelay: 10,
useFakeTimers: true,
useFakeServer: true,
test: () => {
this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST');
let core = new AppInsightsCore();

let coreConfig = {
instrumentationKey: "000e0000-e000-0000-a000-000000000000",
featureOptIn : {["zipPayload"]: {mode: 3}},
extensionConfig: {
[this._sender.identifier]: {
httpXHROverride: this.xhrOverride,
alwaysUseXhrOverride: true,
}
}
}

core.initialize(coreConfig, [this._sender]);

const telemetryItem: ITelemetryItem = {
name: 'fake item with some really long name to take up space quickly',
iKey: 'iKey',
baseType: 'some type',
baseData: {}
};
this._sender.processTelemetry(telemetryItem);
this._sender.flush();
this.clock.tick(10);

return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => {
if (this.genericSpy.called) {
let request = this.genericSpy.getCall(0).args[0];
let gzipData = request.data;
QUnit.assert.ok(gzipData, "data should be set");
QUnit.assert.equal(true, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should be gzip encoded");
QUnit.assert.equal(request.headers["Content-Encoding"], "gzip", "telemetry should be gzip encoded");
return true;
}
return false;
}, "Wait for promise response" + new Date().toISOString(), 60, 1000));
}
});

this.testCase({
name: "zip test: gzip encode is disabled (feature opt-in not set)",
pollDelay: 10,
useFakeTimers: true,
useFakeServer: true,
test: () => {
this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST');
let core = new AppInsightsCore();

let coreConfig = {
instrumentationKey: "000e0000-e000-0000-a000-000000000000",
extensionConfig: {
[this._sender.identifier]: {
httpXHROverride: this.xhrOverride,
alwaysUseXhrOverride: true,
}
}
}

core.initialize(coreConfig, [this._sender]);

const telemetryItem: ITelemetryItem = {
name: 'fake item with some really long name to take up space quickly',
iKey: 'iKey',
baseType: 'some type',
baseData: {}
};
this._sender.processTelemetry(telemetryItem);
this._sender.flush();
this.clock.tick(10);

return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => {
if (this.genericSpy.called){
let request = this.genericSpy.getCall(0).args[0];
let gzipData = request.data;
QUnit.assert.ok(gzipData, "data should be set");
QUnit.assert.equal(false, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should not be gzip encoded");
QUnit.assert.ok(!("Content-Encoding" in request.headers), "telemetry should not be gzip encoded");
return true;
}
return false;
}, "Wait for promise response" + new Date().toISOString(), 60, 1000));
}
});

this.testCase({
name: "Channel Config: Endpoint Url can be set from root dynamically",
useFakeTimers: true,
Expand Down
4 changes: 2 additions & 2 deletions channels/applicationinsights-channel-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"@types/sinon": "4.3.3",
"grunt": "^1.5.3",
"grunt-cli": "^1.4.3",
"@nevware21/grunt-ts-plugin": "^0.4.3",
"@nevware21/grunt-eslint-ts": "^0.2.2",
"@nevware21/grunt-ts-plugin": "^0.5.1",
"@nevware21/grunt-eslint-ts": "^0.5.1",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^24.0.0",
Expand Down
4 changes: 2 additions & 2 deletions channels/offline-channel-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"@types/sinon": "4.3.3",
"grunt": "^1.5.3",
"grunt-cli": "^1.4.3",
"@nevware21/grunt-ts-plugin": "^0.4.3",
"@nevware21/grunt-eslint-ts": "^0.2.2",
"@nevware21/grunt-ts-plugin": "^0.5.1",
"@nevware21/grunt-eslint-ts": "^0.5.1",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^24.0.0",
Expand Down
4 changes: 2 additions & 2 deletions channels/tee-channel-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@types/sinon": "4.3.3",
"grunt": "^1.5.3",
"grunt-cli": "^1.4.3",
"@nevware21/grunt-ts-plugin": "^0.4.3",
"@nevware21/grunt-eslint-ts": "^0.2.2",
"@nevware21/grunt-ts-plugin": "^0.5.1",
"@nevware21/grunt-eslint-ts": "^0.5.1",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^24.0.0",
Expand Down
2 changes: 1 addition & 1 deletion common/Tests/Framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@types/qunit": "^2.19.3",
"@types/sinon": "4.3.3",
"grunt": "^1.5.3",
"@nevware21/grunt-ts-plugin": "^0.4.3",
"@nevware21/grunt-ts-plugin": "^0.5.1",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.2",
Expand Down
Loading
Loading