Skip to content

Instantly share code, notes, and snippets.

@goldbergyoni
Created December 26, 2018 14:23
Show Gist options
  • Select an option

  • Save goldbergyoni/fdd628f0ca8d365fe94de4aada7c6630 to your computer and use it in GitHub Desktop.

Select an option

Save goldbergyoni/fdd628f0ca8d365fe94de4aada7c6630 to your computer and use it in GitHub Desktop.
Doing It Right Example: A human-readable expectation that could be understood easily, maybe even by QA or technical PM
it.only("When no product name, it throws error 400", async() => {
expect(addNewProduct)).to.eventually.throw(AppError).with.property('code', "InvalidInput");
});
@kuzvac
Copy link

kuzvac commented Jan 6, 2019

I think expect(addNewProduct)) have redundant closing bracket. Must be expect(addNewProduct) :)

@bsalesc
Copy link

bsalesc commented Jan 21, 2019

Also use the await statement...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment