Running Dojo DOH tests in a browser without a web server

Dojo’s DOH requires a web server to run tests in a browser. But never fear:

$ cd ~/code/dojo
$ ls
docs  dojo  util
$ python -m SimpleHTTPServer &
$ xdg-open http://localhost:8000/util/doh/runner.html

Note that you will see some test failures, because the python web server doesn’t do PHP.

When finished:

$ kill %1

to stop your web server.

On Python 3, use this instead of the SimpleHTTPServer line:

python3 -m http.server &

Yes, Python includes a little web server that serves files in your current directory. Batteries included. Thanks to Lyle Backenroth and commandlinefu for making me aware of this.

One thought on “Running Dojo DOH tests in a browser without a web server”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.