-
Notifications
You must be signed in to change notification settings - Fork 138
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
Cypress component tests report eslint erorrs #600
Comments
Interesting I get the following: Is it possible that this is related to your work on #601 where you may have removed the ErrorBannerComponent? Try the following command instead... It will generate similar errors:
|
I ran the above command on my laptop using the main branch which still has the Running the |
I can try taking a look into this issue. |
I'm taking a look at the eslint documentation and there's a page on disabling eslint for all JavaScript files [link]. However, this solution isn't working. The errors continue to occur. Alternatively, I could add the lines |
I don't think disabling es-lint in the files is the right solution. The plan eventually will be to have es-lint running in VSCodium and enforcing a style on all of the code so that it is uniform across the project. If it is possible to disable this just for the running of the tests via cypress in the test container that would probably be fine. Maybe there is a flag that you can pass to the Cypress test runner? Then that could be added to the call in the I haven't had much time to investigate this. |
Where exactly is the eslint installed? I'm looking around the project and the fd2dev's docker files, and I can't quite pinpoint exactly where eslint is being introduced. |
I think it must be being installed as part of the normal cypress instal in the dev container. I think I would start by looking at how to run cypress from the command line and then looking at the Note that the |
That looks promising. You may be able to find something that works by making changes in the dev container directly for testing. Ultimately, we'll want to figure out what the issue is and correct it in the An alternative to disabling eslint for the tests would be to figure out how to make it work with Cypress in the dev container. It seems as if eslint is intended to work correctly within Cypress, but for some reason it is not finding the |
It was mentioned that instead of running the |
I would suggest creating a file in |
I noticed that the |
Sounds promising! There seems to be some information here that might be helpful: |
The
|
Installing webpack prior to Cypress might work as long as we ensure that the installed version is compatible with the dependency required by Cypress. One way to test this would be to uninstall webpack that was installed by Cypress and then install it again manually. If everything still works, then this seems like it could be a viable approach. I also wonder if there is a config tool somewhere for webpack? Maybe there is something here: https://webpack.js.org/configuration/ |
I uninstalled webpack and ran the test runner, but it worked as if nothing was uninstalled. I ran the test runner in both the |
Are you saying here that the linting errors were also reported when you ran the tests after uninstalling webpack? |
Yes, the linting errors were reported despite webpack being uninstalled. |
When running the cypress component tests lots of eslint errors are reported. These appear to be a configuration issue rather than an actual issue with the code as they mostly report undefined variables or functions in cypress (e.g. 'cy' is not defined). But the tests themselves run perfectly fine.
Steps to Reproduce
cd
to farmdata2_modules./test_runner.bash ct --spec **/Error*.spec.comp.js
Also note that the test itself passes. This suggests maybe that eslint is running in a different context than the cypress tests themselves. It is worth further note that if the tests are run in the Cypress GUI there is no reporting of eslint errors at all.
Simply disabling the running of eslint before the component tests would be an acceptable solution.
The text was updated successfully, but these errors were encountered: