Skip to content

Commit

Permalink
Only test staticFilesByArch in > Meteor 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
zodern committed Jan 23, 2024
1 parent 607e3a6 commit baa5df1
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions tests/hijack/webapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ if (httpMonitoringEnabled) {
test.equal(req.__kadiraInfo.trace.events[0][2].body, expected);
});

Tinytest.add(
'Webapp - static middleware',
function (test) {
const result = HTTP.get(Meteor.absoluteUrl('global-imports.js'));
test.isTrue(result.content.includes('Package['));
let payload = Kadira.models.http.buildPayload();

let staticMetrics = payload.httpMetrics[0].routes['GET-<static file>'];
test.isTrue(staticMetrics.count > 0);
});
}

if (releaseParts[0] > 1 ||
(releaseParts[0] === 1 && releaseParts[1] > 8)) {
// Meteor 1.8.1 and newer started replacing staticFilesByArch instead of
// mutating the existing object
Tinytest.add(
'Webapp - use latest staticFilesByArch',
function (test) {
Expand All @@ -111,15 +127,4 @@ if (httpMonitoringEnabled) {

WebAppInternals.staticFilesByArch = origStaticFiles;
});

Tinytest.add(
'Webapp - static middleware',
function (test) {
const result = HTTP.get(Meteor.absoluteUrl('global-imports.js'));
test.isTrue(result.content.includes('Package['));
let payload = Kadira.models.http.buildPayload();

let staticMetrics = payload.httpMetrics[0].routes['GET-<static file>'];
test.isTrue(staticMetrics.count > 0);
});
}

0 comments on commit baa5df1

Please sign in to comment.