mbolotov / intellij-cypress

IntelliJ-Cypress plugin: https://plugins.jetbrains.com/plugin/13819-intellij-cypress Pro version: https://plugins.jetbrains.com/plugin/13987-cypress-support-pro
MIT License
35 stars 5 forks source link

node_modules .bin not picked up #1

Closed felixh10r closed 4 years ago

felixh10r commented 4 years ago

First of all, thanks for your plugin!

Technically this is not a problem with your project, but maybe you're able to work around it. When launching cypress with an absolute path, binaries within node_modules are not found (in this case nyc being referenced by cypress-io/code-coverage):

CypressError: cy.task('coverageReport') failed with the following error:

> Error: Command failed with ENOENT: nyc report --report-dir ./coverage --temp-dir .../.nyc_output --reporter=lcov --reporter=clover --reporter=json
spawn nyc ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

I tried (and failed) to alter the PATH in the plugin run configuration, but what worked for me is changing the plugin to use npx, which sets the path correctly:

https://github.com/mbolotov/intellij-cypress/compare/master...fhessenberger:master

This is in no way to be seen as a PR, because I lack basic understanding of the IntelliJ plugin requirements, but maybe it can serve as an inspiration to make this plugin more compatible with various cypress workflows.

If there is another way of achieving this goal, I would very much appreciate your advice – thanks!

mbolotov commented 4 years ago

Hi @fhessenberger! Thanks for reporting this, I'll try to look into a way to integrate 'npx' for running tests. By the way, is there a reproducible repo for the problem?

felixh10r commented 4 years ago

sure, here you go :) https://github.com/fhessenberger/intellij-cypress-repro the demo is not as simple as i'd hoped because for my scenario there has to be at least some app for coverage to be generated but i guess it works with anything implicitly referenced by the test flow.

mbolotov commented 4 years ago

@fhessenberger, I've added support for running Cypress via a package manager Could you please try it?

mbolotov commented 4 years ago

Fixed in 1.1 version

felixh10r commented 4 years ago

@mbolotov sorry, that message went under! works like a charm, thanks 🎉