Skip to content

Instantly share code, notes, and snippets.

@liammclennan
Created April 15, 2011 09:04
Show Gist options
  • Save liammclennan/921432 to your computer and use it in GitHub Desktop.
Save liammclennan/921432 to your computer and use it in GitHub Desktop.
what I think a JavaScript BDD syntax should look like
story("do a thing", function() {
scenario("when I do something under certain conditions", function() {
given("certain conditions", function() {
console.log("certain conditions");
});
when("I do something", function() {
console.log("I do something");
});
then("pigs should fly", function() {
console.log("pigs should fly");
});
and("some other observation", someOtherObservation);
function someOtherObservation() {
console.log("some other observation");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment