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
Challenge tests should be done in browser #4201
Comments
Can confirm any challenge with tests that rely on |
Yup. Will need to put on my thinking cap. |
As far as I'm aware the tests are currently done in the browser. Can this issue be closed? |
@systimotic thanks for looking at these issue deep-dives. |
I would have loved to chime in, but considering this is a very old one, @BerkeleyTrue is the best judge of what this was about then. |
Tests are still not run in the browser. |
Ahhhhh, now I get it, @systimotic @dhcodes, Berkeley is talking about, the This is a build validation step that is currently in console environment only. JS Challenges are tested for breaks in the CI step, by validating against the solutions that you may see with the seed code in the JSON files. This is currently not possible for the jQuery and HTML challenges, and hence need migration to the browser window. Hope this clarifies the understanding. |
Ah, thank you for the clarification @raisedadead! |
I've assigned myself to this one. |
I've got some ideas on how to solve this. Please check #13016 (comment) 😊 |
An idea I have had for HTML testing is passing the HMTL string to react-render-html, and then use react-test-renderer to parse it into a javascript object which we can test easily enough. |
This is something that needs to be done in the browser with the same framework we use to test challenges when a user is using fcc. Abstracts will only introduce more issues and differences that cannot be accounted for. |
@BerkeleyTrue I have been researching lately for one of my day job assignments where we already have been doing testing on Karma and Jasmine (testing framework) to run tests in browser for over a year, and recently I have started some investigation on Headless browsers. So, potentially we could see this implemented here too, with great Travis. Chrome has: Mozilla has: I know you are planning something, but should you be okay, I would like to take this opportunity and try out some prototype. Let me know your thoughts. |
I have in my mind to move over to ava.js for testing (I've used it in several other projects and it is fantastic), but ava does not support browser testing. It does seem possible to do iframe testing using jsdom. If that is possible it might not be needed to do challenge testing in the browser. This is an untested theory but it would make challenge testing pretty fast as ava runs tests in parallel. |
@BerkeleyTrue What do you think of @raisedadead's proposed tool? Should we give him the green light to experiment with it while you work on other parts of the platform? |
@BerkeleyTrue yup, ava.js is totally dope, and while I haven't yet official used it in any of my production projects, but having gone through some of the writeups and a tinkering around, I can clearly see why its on rage. And, to the best of my knowledge, Karma is a (cross-platform) engine which supports any testing framework you plug it into. So, while I am yet to confirm if it will play well with ava.js, I am pretty sure it would be like adding any other library. My main point here is that will headless browsers, we can work with a real-time browser in a CI environment, and this gives us a fair chance to create tests that make the platform stable(-er). Meaning, we will not be faking any DOM, but its the actual DOM without a rendering UI, which is taken care of by headless browsers, and the fact that these are official implements of Chrome and Firefox, (maybe edge/ie and safari will catchup), is a good thing to have. |
@raisedadead if you can get ava working with Karma that would be great, but I suspect it will not be easy. We may end up using mocha/karma for challenge testing and ava for everything else. |
@BerkeleyTrue sure thing, I'll give this a try and let you know. Thanks for the feedback. |
@raisedadead Thanks for giving this a try. Have you had a chance to experiment with it much yet? |
Yup, @QuincyLarson I am checking with the AVA team for support for official adaptor for Karma. |
@raisedadead OK - great. Thanks for keeping us posted on this. |
I'm closing this issue as stale since it hasn't been active lately. If you think this is still relevant to the newly updated platform, please explain why, then reopen it. |
At the moment the only challenges that have solutions are bonfires and javascript challenges. I'm not sure jquery and html challenges would be testable at the moment.
The testing framework needs to be moved into a browser window so tests can be done on iFrames if required.
The text was updated successfully, but these errors were encountered: