-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
docs/content/docs/reference.md → docs/content/docs/functions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: "Reference Other Files" | ||
nav_title: "Reference Other Files" | ||
nav_section: Root | ||
weight: 7 | ||
--- | ||
|
||
Toolproof allows you to reference another file and embed its steps. | ||
|
||
To reference another file, use the `ref` key with a relative path to the target file. | ||
|
||
If we have a file at `tests/simple.toolproof.yml` containing: | ||
```yaml | ||
name: Simple Test | ||
|
||
steps: | ||
- step: I have a "config.js" file with the content {js} | ||
js: |- | ||
console.log("hello world"); | ||
- stdout should contain "hello" | ||
``` | ||
Then a file at `tests/nested/simple-plus.toolproof.yml` could contain: | ||
```yaml | ||
name: Simple Plus More | ||
steps: | ||
- ref: ../simple.toolproof.yml | ||
- snapshot: stderr | ||
``` | ||
|
||
This will embed the steps from the referenced file into this file. | ||
|
||
If we didn't want our original `tests/simple.toolproof.yml` file to run as a standalone test, we can also tell toolproof | ||
that this file is a reference: | ||
```yaml | ||
name: Simple Setup | ||
type: reference | ||
steps: | ||
- step: I have a "config.js" file with the content {js} | ||
js: |- | ||
console.log("hello world"); | ||
``` | ||
|
||
Toolproof will avoid running this file on its own, but will run the steps if they're embedded into another file. | ||
|