constantDef
Import from @varavel/vdl-plugin-sdk/testing.
function constantDef(
name,
value,
overrides?
): ConstantDef;
Creates a ConstantDef with the given name and literal value.
Pass overrides to set annotations or doc.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Constant name. |
value | LiteralValue | Constant literal value. |
overrides? | Partial<Omit<ConstantDef, "position" | "name" | "annotations" | "value">> & object | Optional constant overrides. |
Returns
A ConstantDef with defaults applied.
Example
constantDef("ApiVersion", stringLiteral("v1"));
// returns a constant definition named "ApiVersion"