Skip to content

Commit

Permalink
fix(ses): Hermes smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
leotm committed Jul 25, 2024
1 parent 4ab54d8 commit 1fc02a7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/ses/test/hermes-smoke.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import '../dist/ses.cjs';
import '../src/assert-shim.js';
// TODO: equivalent of:
// import '../dist/ses.cjs';
// import '../src/assert-shim.js';
// Since Hermes has no native support for I/O

// Test lockdown

Expand All @@ -12,14 +14,14 @@ const c = new Compartment();
c.evaluate('1+1');
c.evaluate("const c2 = new Compartment(); c2.evaluate('1+2')");

// Test importHook and resolveHook (non-ESM)
// Test importHook and resolveHook

// https://github.com/facebook/hermes/blob/main/doc/Features.md
// In Progress: ES modules (`import` and `export`)

const resolveHook = '';

const importHook = async () => {
async function importHook () {
return {
imports: [],
exports: ['meaning'],
Expand All @@ -33,9 +35,9 @@ const compartment = new Compartment({}, {}, { resolveHook, importHook });

const module = compartment.module('.');

const {
namespace: { _meaning },
} = await compartment.import('.');
// const {
// namespace: { _meaning },
// } = await compartment.import('.');

assert(module);
// t.is(meaning, 42, 'exports seen');
Expand Down

0 comments on commit 1fc02a7

Please sign in to comment.