test(ses): Test dynamic eval detection
ADD
packages/ses/test/test-evalability.js
+import test from 'ava';
+import './unevalability.js';
+import '../index.js';
+
+test('lockdown must throw if dynamic eval is unavailable at initialization time', t => {
+ t.throws(() => lockdown({ errorTaming: 'unsafe' }));
+});

ADD
packages/ses/test/unevalability.js
+/* global globalThis */
+// This is a fixture for test-evalability.js which ensures that dynamic
+// eval is available at the time of SES initialization.
+// eslint-disable-next-line no-eval
+const originalEval = eval;
+// eslint-disable-next-line no-eval
+globalThis.eval = source => originalEval(source);

test(ses): Test dynamic eval detection