hush eslint, improve test slightly
MODIFY
test/test-require.js
test/test-require.js
@@ -8,12 +8,12 @@ test('SES environment lacks require by default', t => {
});
test('SES environment can have require(nat)', t => {
- const s = SES.makeSESRootRealm({requireMode: 'allow', errorStackMode: 'allow', consoleMode: 'allow'});
- t.notEqual(typeof s.global.require, 'undefined');
+ const s = SES.makeSESRootRealm({ requireMode: 'allow' });
+ t.equal(typeof s.global.require, 'function');
function check() {
+ // eslint-disable-next-line global-require,import/no-unresolved
const Nat = require('nat');
- //console.log(`Nat is ${typeof Nat}`);
- const n = x => Nat(x); // eslint-disable-line no-undef
+ const n = x => Nat(x);
return { n, Nat };
}
// console.log(`REQ src is ${check}`);
@@ -23,7 +23,7 @@ test('SES environment can have require(nat)', t => {
t.equal(n(0), 0);
t.equal(n(1), 1);
t.equal(n(999), 999);
- t.equal(n((2**53)-1), (2**53)-1);
+ t.equal(n(2 ** 53 - 1), 2 ** 53 - 1);
t.throws(() => n('not a number'), s.global.RangeError);
t.throws(() => n(-1), s.global.RangeError);
t.throws(() => n(0.5), s.global.RangeError);

hush eslint, improve test slightly