From c2de4d4d2e01faee41c9d7dca387a8308b4b7b90 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig Date: Sat, 15 Dec 2018 13:05:24 +0100 Subject: [PATCH] Make test meaningfull --- packages/core/parcel-bundler/test/scope-hoisting.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/core/parcel-bundler/test/scope-hoisting.js b/packages/core/parcel-bundler/test/scope-hoisting.js index 3bc3b341408..34c07c52117 100644 --- a/packages/core/parcel-bundler/test/scope-hoisting.js +++ b/packages/core/parcel-bundler/test/scope-hoisting.js @@ -433,12 +433,13 @@ describe('scope hoisting', function() { assert(!contents.includes('bar')); }); - it('removes unused function exports', async function() { + it('removes unused function exports when minified', async function() { let b = await bundle( path.join( __dirname, '/integration/scope-hoisting/es6/tree-shaking-functions/a.js' - ) + ), + {minify: true} ); let output = await run(b); @@ -448,8 +449,9 @@ describe('scope hoisting', function() { path.join(__dirname, '/dist/a.js'), 'utf8' ); - assert(contents.includes('add')); - assert(!contents.includes('sub')); + console.log(contents); + assert(/.\+./.test(contents)); + assert(!/.\-./.test(contents)); }); it('support exporting a ES6 module exported as CommonJS', async function() {