ewngs / szamlazz.js

Node.js client for Szamlazz.hu
MIT License
38 stars 34 forks source link

test: remove unnecessary done() and use "rejectedWith" instead of try/catch #41

Closed ert78gb closed 1 year ago

ert78gb commented 1 year ago

The problem of the following code snippet is if try block does not throw an exception then the catch block will not call, so the assertion will not run and the test will pass.

try {
  await client.issueInvoice(invoice)
} catch (e) {
  expect(e.message).to.be.string('Some error message from the remote service')
}