-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing: Bring back Mocha integration with IDEs #6076
Comments
I think the regression might be introduced in 336f74b , it's the commit where the script started to return |
Yup, that should be it, I execute Mocha from terminal integration in PhpStorm, so I never played with this script ;) |
Oh I see, are you able to get the parsed and categorized results displayed inside the IDE with terminal integration? |
Nope, that's why I'm interested in learning how to integrate it better :D |
Gotcha, hope to see it back soon :) |
Do we need an extra file for IDE integration? Can we run lines like: |
does it work this way? |
Yessir :) -- this way we don't need to maintain any extra files / duplicate logic. If you check out the scripts in package.json you can see exactly what is being run when we type npm run test: https://github.com/Automattic/wp-calypso/blob/master/package.json#L135-L138 EDIT: Does NOT work this way. I misunderstood how Webstorm needs to be configured |
I might be wrong, but I don't think it's enough to integrate with PhpStorm or Webstorm, the way @umurkontaci previously did it. It looks like to make it happen you need to have script executed by the
|
Related PR for reference: #4111. |
You are indeed right @gziolo , the entrypoint has to be the mocha executable and the first argument is the script has includes all the tests. I think there are a couple of approaches here, if we are to remove the secondary file, we might do a check to see if the script is being imported or running standalone. That being said, we now have a pretty structured test folder structure, we might be able to have one script that does the environment setup with The second approach still requires maintaining another file or a piece of code, but it'll also let us run tests selectively within integrations. |
Thanks @umurkontaci / @gziolo, you two were very right. I was able to get IDE integration by following the first approach (performing the referenced check). While it forces us to 'require' every test file, we can pass in configurations to only run specific test-suites. Here is an example of only running PostEditor tests: |
It's no longer an issue since we migrated to Jest. See #16943. |
Part of #4915.
We had working integration with tooling such as Webstorm. It no longer works properly when you execute command like:
NODE_ENV=test NODE_PATH=client:test node_modules/.bin/mocha test/run-mocha.js
Latest code looks like:
https://github.com/Automattic/wp-calypso/blob/db8925cb20a8744c07be8c82dc7e4edfb086fbc6/test/run-mocha.js
It would be great to bring integration back and make sure documentation is up to date.
The text was updated successfully, but these errors were encountered: