mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2025-12-12 02:00:18 +01:00
docs: document new lib functions & usage
This commit is contained in:
parent
116f905b6c
commit
bc36c39b09
4 changed files with 93 additions and 6 deletions
53
docs/reference.md
Normal file
53
docs/reference.md
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# Reference
|
||||
|
||||
## `flakeModule`
|
||||
|
||||
The `flakeModule` for [flake-parts](https://flake.parts).
|
||||
|
||||
## `lib`
|
||||
|
||||
### `module`
|
||||
|
||||
The nix module for validation of inputs etc.
|
||||
Used internally by `mkNixtestConfig`.
|
||||
|
||||
### `autodiscover`
|
||||
|
||||
```nix
|
||||
autodiscover {
|
||||
dir,
|
||||
pattern ? ".*_test.nix",
|
||||
}
|
||||
```
|
||||
|
||||
Finds all test files in `dir` matching `pattern`.
|
||||
Returns a list of modules (can be passed to `mkNixtest`'s `modules` arg).
|
||||
|
||||
### `mkNixtestConfig`
|
||||
|
||||
```nix
|
||||
mkNixtestConfig {
|
||||
modules,
|
||||
args ? {},
|
||||
}
|
||||
```
|
||||
|
||||
Evaluates the test `modules`.
|
||||
`args` are passed to the modules using `_module.args = args`.
|
||||
|
||||
**Noteworthy attributes**:
|
||||
|
||||
- `app`: nixtest wrapper
|
||||
- `finalConfigJson`: derivation containing the tests json file
|
||||
|
||||
### `mkNixtest`
|
||||
|
||||
```nix
|
||||
mkNixtest {
|
||||
modules,
|
||||
args ? {},
|
||||
}
|
||||
```
|
||||
|
||||
Creates the nixtest wrapper, using the tests in `modules`.
|
||||
Basically `(mkNixtestConfig <arguments>).app`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue