Skip to content

Commit

Permalink
remove weak from optionalDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jul 10, 2017
1 parent abab199 commit e099d8c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 30 deletions.
24 changes: 1 addition & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Expand Up @@ -79,8 +79,5 @@
"dist",
"bin/rollup",
"README.md"
],
"optionalDependencies": {
"weak": "^1.0.1"
}
]
}
18 changes: 15 additions & 3 deletions test/leak/test.js
@@ -1,8 +1,8 @@
var path = require('path')
var rollup = require('../..')

try {
var weak = require('weak')
function test() {
var weak = require('weak');

var shouldCollect = false;
var isCollected = false;
Expand Down Expand Up @@ -36,6 +36,18 @@ try {
console.error(err.message);
process.exit(1);
});
}

try {
require.resolve('weak');
test();
} catch (err) {
console.log(`skipping memory leak test`);
console.log('installing weak');
require('child_process').exec('npm i --no-save --silent weak@1.0.1', function (err, stdout, stderr) {
if (err) {
console.log('failed to install weak');
} else {
test();
}
});
}

0 comments on commit e099d8c

Please sign in to comment.