summaryrefslogtreecommitdiff
path: root/tools/test-helper/README.md
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-04-13 10:39:45 +0200
committerLaurenz <laurmaedje@gmail.com>2024-05-17 14:27:59 +0200
commite039552f9d7bb49da8dafe7a83b87a08202eb30f (patch)
tree264b461722f758d85217da804550620cd74b4f9e /tools/test-helper/README.md
parent8e025c9cdfbb0a5dae536aafc27b5e19eeac1810 (diff)
Better test runner (#3922)
Diffstat (limited to 'tools/test-helper/README.md')
-rw-r--r--tools/test-helper/README.md38
1 files changed, 22 insertions, 16 deletions
diff --git a/tools/test-helper/README.md b/tools/test-helper/README.md
index 0b10c454..f95b8d73 100644
--- a/tools/test-helper/README.md
+++ b/tools/test-helper/README.md
@@ -1,23 +1,29 @@
# Test helper
This is a small VS Code extension that helps with managing Typst's test suite.
-When installed, three new buttons appear in the menubar for all `.typ` files in
-the `tests` folder.
+When installed, a new Code Lens appears in all `.typ` files in the `tests`
+folder. It provides the following actions:
-- Open: Opens the output and reference images of a test to the side.
-- Refresh: Refreshes the preview.
-- Rerun: Re-runs the test.
-- Update: Copies the output into the reference folder and optimizes
- it with `oxipng`.
+- View: Opens the output and reference image of a test to the side.
+- Run: Runs the test and shows the results to the side.
+- Terminal: Runs the test in the integrated terminal.
-For the test helper to work correctly, you also need to install `oxipng`, for
-example with `cargo install oxipng`. Make sure that the version of oxipng you
-install is the same as the one in the root `Cargo.toml` so that the results are
-the same as when using the test CLI.
+In the side panel, there are a few menu actions at the top right:
+
+- Refresh: Reloads the panel to reflect changes to the images
+- Run: Runs the test and shows the results
+- Save: Runs the test with `--update` to save the reference image
## Installation
-The simplest way to install this extension (and keep it up-to-date) is to use VSCode's UI:
-* Go to View > Command Palette,
-* In the drop down list, pick command "Developer: Install extension from location",
-* Select this `test-helper` directory in the file explorer dialogue box. VSCode will add
-the extension's path to `~/.vscode/extensions/extensions.json`.
+First, you need to build the extension:
+```bash
+npm i
+npm run build
+```
+
+Then, you can easily install and (and keep it up-to-date) via VS Code's UI:
+- Go to View > Command Palette or press Cmd/Ctrl+P,
+- In the drop down list, pick command "Developer: Install extension from
+ location",
+- Select this `test-helper` directory in the file explorer dialogue box. VS Code
+ will add the extension's path to `~/.vscode/extensions/extensions.json`.