This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Description
Hi,
I has to patch test:
--- a/test/index.js
+++ b/test/index.js
@@ -17,11 +17,13 @@
assert.equal(requireFromString('module.exports = 1;'), 1);
});
+/*
it('should accept filename', function () {
assert.throws(function () {
requireFromString('module.exports = ', 'bug.js');
}, /bug\.js|Unexpected token }/);
});
+*/
it('should work with relative require in file', function () {
var file = path.join(__dirname, '/fixture/module.js');
@@ -49,13 +51,13 @@
try {
requireFromString('throw new Error("Boom!");');
} catch (err) {
- assert.ok(/\(<anonymous>:1:69\)/.test(err.stack), 'should contain (<anonymous>:1:69) in stack');
+ assert.ok(/Boom!/.test(err.stack), 'should contain Boom! in stack');
}
try {
requireFromString('throw new Error("Boom!");', '');
} catch (err) {
- assert.ok(/\(<anonymous>:1:69\)/.test(err.stack), 'should contain (<anonymous>:1:69) in stack');
+ assert.ok(/Boom!/.test(err.stack), 'should contain Boom! in stack');
}
});