Skip to content

Problem in basic usage #33

@lazywithclass

Description

@lazywithclass

Hello, thanks a lot for this library.

I am evaluating it to see if I could use for a mutation testing library I am writing, I've setup a basic scenario to see how it works:

// source.js
var lib = {};

lib.fn = function() {
  return true;
};

module.exports = lib;

// test.js
describe('fn', function() {

  var lib = require('./source'),
      expect = require('chai').expect;

  it('returns true', function() {
    expect(lib.fn()).to.be.true;
  });

});

// runner.js
require = require('really-need');
var foo = require('./test', {
  pre: function (source, filename) {
    return source;
  }
});

When I run it it gives me an error, it's quite long, I'll paste what I think it's relevant (here the whole thing https://gist.github.com/lazywithclass/93898774a3644be63c32)

patched compile has crashed
internalModule is not defined
ReferenceError: internalModule is not defined
    at Module.eval (eval at <anonymous> (/Users/lazywithclass/workspace/mutagen/node_modules/really-need/index.js:230:25), <anonymous>:30:19)
    at Module._compile (/Users/lazywithclass/workspace/mutagen/node_modules/really-need/index.js:251:29)
    at load (/Users/lazywithclass/workspace/mutagen/node_modules/really-need/index.js:73:12)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at loadRealModule (/Users/lazywithclass/workspace/mutagen/node_modules/really-need/index.js:133:23)
    at Module.reallyNeedRequire [as require] (/Users/lazywithclass/workspace/mutagen/node_modules/really-need/index.js:181:16)
    at Object.<anonymous> (/Users/lazywithclass/workspace/mutagen/test/mutation-true-false/mutator.js:24:11)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

I am running node 4.3.1and really-need 1.9.2.

Any hint / help would be greatly appreciated.

UPDATE: Using node 4.2.2 and fake seems to solve the issue... but still I am looking at your code to understand how can I use it with newer versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions