mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
Until now, we didn't have a nice way to check that we expect a specific JS error in the web page. This PR improves check_js_errors() so that now you can pass a list of error messages that you expect. It is tricky because we need to handle (and test!) all various combinations of cases: - errors expected and found / expected but not found - unexpected errors found / not found Moreover, JS exceptions now are logged in the special category console.js_error, which means that the printed text is also available using e.g. self.console.js_error.text or self.console.all.text. However, this should never be required and it's preferred to use self.check_js_errors to check for exceptions. This fixes #795 . Finally, use the new logic to improve test_no_implicit_target.
PyScript Demonstrator
A simple webapp to demonstrate the capabilities of PyScript.
Getting started
-
If you don't already have Node.js, install it. The official installer for the LTS version of Node is available from nodejs.org.
-
If you don't already have Rollup, install it. Rollup can be installed as a global resource using:
$ npm install --global rollup -
Install the demo apps requirements:
$ npm install -
Start the server:
$ npm run devThis will compile the resources for the app, and start the development server.
-
When the compilation completes, it will display something like:
Your application is ready~! 🚀 - Local: http://localhost:8080 - Network: Add `--host` to expose ────────────────── LOGS ──────────────────Once this is visible, open a browser at http://localhost:8080. This will provide a list of demos that you can run.
More information
There is a forum PyScript where you can discuss the project or ask questions at https://community.anaconda.cloud/c/pyscript