HuddleEng / PhantomCSS

Visual/CSS regression testing with PhantomJS
MIT License
4.72k stars 259 forks source link

Resemble.js not found when using init #152

Closed cazgp closed 8 years ago

cazgp commented 8 years ago

When using phantomcss.init to set the screenshotRoot and other variables, the script fails because Resemble.js is not found. It seems this is being circumvented in the demo code by setting libraryRoot to a hard-coded value.

It seems counter-intuitive that using completely unrelated keys in the init function should so badly affect libraryRoot. Additionally, the way the Renderer.js path is being found is odd. It makes sense to simply do something like:

_resemblePath = options.resemblePath || require.resolve('resemblejs')

Currently this might be a bug as options.resemblePath is actually _resemblePath which is undefined.

I got a bit lost with all the file naming conventions as well. All I want to do is prevent a folder with the name undefined from appearing in test/integrations, but it's a bit unclear what value needs to be set to do that. And playing around with absolute paths goes against the npm ethos of being able to npm run from anywhere.

cazgp commented 8 years ago

I see why the require.resolve thing won't work now. Eugh casperjs require patch is not nice! Still it would be nice if an unrelated call to init didn't bodge everything up, although it looks quite fiddly to fix.