Skip to content

Commit

Permalink
test(compartment-mapper): document lack of live bindings in bundler w…
Browse files Browse the repository at this point in the history
…ith a test
  • Loading branch information
naugtur committed Aug 29, 2024
1 parent a1a1a42 commit 5964073
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
14 changes: 14 additions & 0 deletions packages/compartment-mapper/test/bundle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const fixture = new URL(
'fixtures-0/node_modules/bundle/main.js',
import.meta.url,
).toString();
const fixtureUnsupported = new URL(
'fixtures-0/node_modules/bundle/unsupported.js',
import.meta.url,
).toString();

const { read } = makeReadPowers({ fs, url });

Expand Down Expand Up @@ -83,6 +87,16 @@ test('equivalent archive behaves the same as bundle', async t => {
t.deepEqual(log, expectedLog);
});

test('unsupported: live binding in bundle throws', async t => {
const bundle = await makeBundle(read, fixtureUnsupported);
const compartment = new Compartment({
__options__: true,
});
t.throws(() => {
compartment.evaluate(bundle);
},{message: /buzz is not defined/});
});

// This is failing because it requires support for missing dependencies.
// Cannot bundle: encountered deferredError Cannot find file for internal module "./spam"
test.failing('bundle cjs-compat', async t => {
Expand Down

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

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

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

0 comments on commit 5964073

Please sign in to comment.