diff --git a/packages/core/integration-tests/test/scope-hoisting.js b/packages/core/integration-tests/test/scope-hoisting.js index 99a73cae3de..e5e98cc0b61 100644 --- a/packages/core/integration-tests/test/scope-hoisting.js +++ b/packages/core/integration-tests/test/scope-hoisting.js @@ -51,27 +51,6 @@ const bundler = (name, opts = {}) => { describe('scope hoisting', function () { describe('es6', function () { - it('should wrap when this could refer to an export', async function () { - let b = await bundle( - path.join(__dirname, '/integration/exports-this/a.js'), - { - mode: 'production', - defaultTargetOptions: { - shouldScopeHoist: true, - shouldOptimize: false, - }, - }, - ); - - let contents = await outputFS.readFile( - b.getBundles().find(b => /a\.js/.test(b.filePath)).filePath, - 'utf8', - ); - - let exports_found = contents.includes('$exports$'); - assert.equal(exports_found, false); - }); - it('supports default imports and exports of expressions', async function () { let b = await bundle( path.join( @@ -3595,6 +3574,27 @@ describe('scope hoisting', function () { }); describe('commonjs', function () { + it('should wrap when this could refer to an export', async function () { + let b = await bundle( + path.join(__dirname, '/integration/exports-this/a.js'), + { + mode: 'production', + defaultTargetOptions: { + shouldScopeHoist: true, + shouldOptimize: false, + }, + }, + ); + + let contents = await outputFS.readFile( + b.getBundles().find(b => /a\.js/.test(b.filePath)).filePath, + 'utf8', + ); + + let exports_found = contents.includes('exports.bar()'); + assert.equal(exports_found, true); + }); + it('supports require of commonjs modules', async function () { let b = await bundle( path.join(