Skip to content

Instantly share code, notes, and snippets.

@ig-perez
Created December 4, 2019 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ig-perez/b4d83d6209577513d6df8f6f6dba1a92 to your computer and use it in GitHub Desktop.
Save ig-perez/b4d83d6209577513d6df8f6f6dba1a92 to your computer and use it in GitHub Desktop.
Bespoken Sample: Using the UNIT_TEST environment variable to make your tests more predictably
sessionAttributes.guessNumber = Math.floor(Math.random() * 100);
// For testing purposes, force a number to be picked if the UNIT_TEST environment variable is set
if (process.env.UNIT_TEST) {
sessionAttributes.guessNumber = 50;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment