Skip to content

Instantly share code, notes, and snippets.

@cacheflow
Created October 16, 2018 17:18
Show Gist options
  • Save cacheflow/012ec6731f691210cc2de3e21a7caa3f to your computer and use it in GitHub Desktop.
Save cacheflow/012ec6731f691210cc2de3e21a7caa3f to your computer and use it in GitHub Desktop.
it('should not autoinstall if PARCEL_AUTOINSTALL is set to false', async function() {
const inputDir = path.resolve(
__dirname,
'integration',
'dont-autoinstall-if-env-var-is-set-to-false'
);
try {
let a = await bundle(path.resolve(inputDir, './index.js'));
await run(a);
} catch (e) {
let pkg = await fs.readFile(
path.resolve(inputDir, 'package.json'),
'utf8'
);
const pkgName = 'lodash';
pkg = JSON.parse(pkg);
console.log('pkg is ', pkg);
assert(pkgName in pkg.dependencies === false);
assert(e.message.includes("Cannot resolve dependency 'lodash'"));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment