Docker での Qunit

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.

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?

「いいね!」 3

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 Beginner’s Guide to Creating Discourse Plugins Part 6: Acceptance Tests to mention that the port is different for the Docker way.
Kind regards
Alexander

「いいね!」 1

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

「いいね!」 1

I have no repro here, have you started from a clean slate? Try:

cd discourse
sudo rm -fr data
d/shutdown_dev
d/boot_dev --init

Then visit localhost:9292/qunit

Works fine here.

「いいね!」 1

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

「いいね!」 1

私も同じエラーを受け取っていました:

これは、新規インストールの Pop!_OS 20.04(非 Docker)で発生しました。以下のコマンドを実行することで解決しました。

bundle exec bin/rake qunit:test

テスト実行を開始する前に、多くの npm パッケージがインストールされていることに気づきました。それが完了したら、Rails サーバーを再起動し、ブラウザで localhost:3000/qunit にアクセスして QUnit を利用できるようになりました。

「いいね!」 5