Skip to content

Instantly share code, notes, and snippets.

@mdr
Created April 1, 2021 17:23
Show Gist options
  • Save mdr/7af329941ee9d9c530240e4a7a6e27c4 to your computer and use it in GitHub Desktop.
Save mdr/7af329941ee9d9c530240e4a7a6e27c4 to your computer and use it in GitHub Desktop.
const loadSpec = async () => ({
given: () => "I have 100 shares of MSFT stock",
when: () => "When I ask to sell 20 shares of MSFT stock",
then: () => "Then I should have 80 shares of MSFT stock"
})
const printSpec = async () => {
const { given, when, then } = await loadSpec()
console.log(given())
console.log(when())
console.log(then())
}
await printSpec()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment