Skip to content

Commit

Permalink
fix(bundle-source): assert that the entrypoint exists at all
Browse files Browse the repository at this point in the history
closes #1206
  • Loading branch information
warner committed Aug 16, 2022
1 parent fe9c784 commit 2b92db7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/bundle-source/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ export default async function bundleSource(
options = {},
powers = undefined,
) {
assert(fs.existsSync(startFilename));
if (typeof options === 'string') {
options = { format: options };
}
Expand Down
9 changes: 9 additions & 0 deletions packages/bundle-source/test/test-missing-entrypoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { lockdown } from '@endo/lockdown';

import test from 'ava';
import bundleSource from '../src/index.js';

test(`missing entrypoint`, async t => {
await t.throwsAsync(() => bundleSource('___missing.js', 'endoZipBase64'),
{ message: 'xxx' });
});

0 comments on commit 2b92db7

Please sign in to comment.