Skip to content

Commit

Permalink
remove function
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoventurini committed Nov 7, 2023
1 parent b4b2576 commit 8a8963c
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ Package.onTest(function (api) {
'tests/event_loop_monitor.js',
], 'server');

if (canRunTestsWithFetch()) {
api.addFiles(['tests/hijack/http_fetch.js'], 'server');
}
api.addFiles(['tests/hijack/http_fetch.js'], 'server');

// common client
api.addFiles([
Expand All @@ -110,21 +108,6 @@ Package.onTest(function (api) {
], ['client', 'server']);
});

// use meteor/fetch in tests only for NodeJS 8.11+ (Meteor 1.7+)
function canRunTestsWithFetch () {
const nums = process.versions.node.split('.').map(Number);

const major = nums[0];
const minor = nums[1];

if (major < 8) return false;

if (major > 8) return true;

// major === 8 and ...
return minor >= 11;
}

function configurePackage (api, isTesting) {
api.versionsFrom('[email protected]');
api.use('montiapm:[email protected]', ['server']);
Expand All @@ -143,7 +126,7 @@ function configurePackage (api, isTesting) {
api.use(['http', 'email'], 'server', { weak: !isTesting });

api.use('fetch', 'server', {
weak: !(isTesting && canRunTestsWithFetch()),
weak: !isTesting,
});

api.use(['random', 'ecmascript', 'tracker'], ['client']);
Expand Down

0 comments on commit 8a8963c

Please sign in to comment.