Skip to content

Commit

Permalink
update test: move to commonjs and change search
Browse files Browse the repository at this point in the history
  • Loading branch information
achan3 committed Oct 6, 2023
1 parent 2895285 commit 93d566d
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions packages/core/integration-tests/test/scope-hoisting.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 93d566d

Please sign in to comment.