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

Test fails with nodejs >= 10.16 #25

@guimard

Description

@guimard

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');
        }
 });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions