Hi,
I followed the Beginners Guide to Install Discourse for Development using Docker, wrote my plugin and would now like to write tests for it. However, the qunit site is not accessible at http://localhost:3000/qunit (ERR_EMPTY_RESPONSE), but the Discourse installation on port 9292 is working fine. Do I need to pass some additional parameter to unicorn to make it run qunit as well? I ran boot_dev with the -p option, so that can’t be it.
AI-generated summary
A user, AlexanderFillbrunn, is having trouble accessing the QUnit test runner at http://localhost:3000/qunit in a Docker development environment, receiving an ERR_EMPTY_RESPONSE. Another user, david, clarifies that the correct URL should be http://localhost:9292/qunit since that is the default port for Docker. After correcting the URL, Alexander still encounters a Sprockets::FileNotFound error for qunit/qunit/qunit. sam suggests a clean restart using d/shutdown_dev and d/boot_dev --init, but this doesn’t resolve the issue for Alexander on macOS Catalina. blake shares a solution from a non-Docker setup, where running bundle exec bin/rake qunit:test resolved the issue by installing necessary npm packages, allowing access to QUnit at localhost:3000/qunit.
If Discourse is on port 9292, then qunit will be there as well. http://localhost:9292/qunit
3000 is the default port, so maybe you changed some configuration?
Hi,
thanks a lot, that works. Port 9292 is the default for the Docker development environment, I did not change it. Maybe it makes sense to update the post at Developing Discourse Plugins - Part 6 - Add acceptance tests to mention that the port is different for the Docker way.
Kind regards
Alexander
Sorry, it still does not work. I do not get the previous error anymore and the page title shows up as QUnit Test Runner, but the page is empty and the console says: Uncaught Error: Sprockets::FileNotFound: couldn't find file 'qunit/qunit/qunit' with type 'application/javascript'.
Kind regards
Alexander
Hi @sam,
thanks for your reply. I removed the data directory, pulled the latest master and started the container again, but the problem still persists. I am on macOS Catalina. If you need any other information, let me know.
Kind regards
Alexander
I also was receiving this same error:
on a fresh Pop!_OS 20.04 install (non-docker). I resolved it by running
bundle exec bin/rake qunit:test
and I noticed it installed a bunch of npm packages before starting to run the tests. Once that was done, I started the rails server back up and I could access qunit in the browser with localhost:3000/qunit.
