60frames / jestpack

Jest Webpack Integration
MIT License
66 stars 3 forks source link

Runtime Error Error: Cannot find module 'jest-cli/src/lib/moduleMocker' #17

Open lauterry opened 8 years ago

lauterry commented 8 years ago

Hello

I'm using Jest-cli 11.0.2 with JestPack 0.1.1 and I got the following error :

Error: Cannot find module 'jest-cli/src/lib/moduleMocker'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/lauthierry/workspace/front/node_modules/jestpack/ModuleLoader.js:8:20)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)

It seems that the moduleMocker have to be required like this :

const moduleMocker = require('jest-mock');

instead of

const moduleMocker = require('jest-cli/src/lib/moduleMocker');

Can you publish a new version compatible with Jest-cli 11.0.2 please ?

Best regards

richardscarrott commented 8 years ago

@lauterry Unfortunately Jestpack doesn't currently support Jest >0.7.x and given all the changes made in recent versions of Jest it'll be hard to fix the problems. Ultimately I don't think the approach Jestpack takes is viable going forward, it's too intrusive.

I've got some simpler ideas for getting Webpack and Jest to work together so I'll try and get an example up soon.

lauterry commented 8 years ago

hi @richardscarrott

Thanks for your answer.

Can't wait to see your example on how to get Webpack work with Jest.

Cheers