Skip to content

Commit

Permalink
Merge pull request #105 from jasalt/master
Browse files Browse the repository at this point in the history
Improve test runner documentation
  • Loading branch information
Chemaclass authored Dec 29, 2024
2 parents b901c22 + 61e9290 commit 0140895
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
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;
}
}

0 comments on commit 0140895

Please sign in to comment.