Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test runner documentation #105

Merged
merged 4 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion content/documentation/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,24 @@ Test can be defined by using the `deftest` macro. This macro is like a function

Tests can be run using the `./vendor/bin/phel test` command. Tests are looked up recursively in all directories set by [setTestDirs](/documentation/configuration/#testdirs) configuration option which defaults to `tests/`.

If you want to run the test manually, the `run-tests` function can be used. As arguments, it takes a map of options (that can be empty) and one or more namespaces that should be tested.
Pass filenames as arguments to the `phel test` command to run tests in specified files only:

```bash
./vendor/bin/phel test tests/main.phel tests/utils.phel
```

To filter tests that should run by name, `--filter` command line argument can be used:

```bash
./vendor/bin/phel test tests/utils.phel --filter my-test-function
```

Test report can be set to more verbose TestDox format showing individual test names with `--testdox` flag. Output can also be suppressed with `--quiet` flag to only include errors or silenced fully with `--silent` flag.

See more options available by running `./vendor/bin/phel test --help`.


If you want to run tests from Phel code, the `run-tests` function can be used. As arguments, it takes a map of options (that can be empty) and one or more namespaces that should be tested.

```phel
(run-tests {} 'my\ns\a 'my\ns\b)
Expand Down
14 changes: 7 additions & 7 deletions sass/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@
}

.site-header__search {
display: none;
display: block;

@include desktop {
display: block;
input {
padding: 0.2rem;
font-size: initial;
}

input {
padding: 0.2rem;
font-size: initial;
}
@include tablet {
margin-left: auto;
}
}

Expand Down
6 changes: 6 additions & 0 deletions sass/_macros.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
@content;
}
}

@mixin tablet {
@media (max-width: 1039px) {
@content;
}
}
Loading