-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs for dynamic types tests (#1307)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > This PR adds documentation for testing dynamic types in BAML, detailing the use of `type_builder` and `dynamic` blocks with examples for dynamic classes and enums. > > - **Documentation**: > - Adds section on testing dynamic types in `testing-functions.mdx`, `dynamic-types.mdx`, `dynamic.mdx`, `test.mdx`, and `typebuilder.mdx`. > - Includes examples for dynamic classes and enums using `type_builder` and `dynamic` blocks. > - Updates `snippets/dynamic-class-test.mdx` with a code example for dynamic class testing. > - **Dynamic Types**: > - Explains how to modify dynamic classes and enums in tests using `type_builder` and `dynamic` blocks. > - Describes testing scenarios for return types and parameter types with dynamic modifications. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for babb416. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
1 parent
7f852d0
commit 9c068e0
Showing
6 changed files
with
252 additions
and
5 deletions.
There are no files selected for viewing
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
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,22 @@ | ||
```baml {3, 12-16} | ||
class DynamicClass { | ||
static_prop string | ||
@@dynamic | ||
} | ||
function ReturnDynamicClass(input: string) -> DynamicClass { | ||
// ... | ||
} | ||
test DynamicClassTest { | ||
functions [ReturnDynamicClass] | ||
type_builder { | ||
dynamic DynamicClass { | ||
new_prop_here string | ||
} | ||
} | ||
args { | ||
input "test data" | ||
} | ||
} | ||
``` |