Skip to main content

var

Function var 

Source
pub fn var(name: &str) -> Option<String>
Expand description

A variable of the app under test: the environment variable name, else its value in .dev.vars (the file ocre dev loads), as the Worker sees it. Request tests use it for the secrets they sign with (a webhook’s).

§Examples

let secret = ocre::testing::var("PAYMENTS_WEBHOOK_SECRET").expect("in .dev.vars");