jeudi 8 mars 2018

Unit testing a function without any response

I have the following function written in an Ember route

  delete(line) {
    line.destroyRecord().then(() => {
      this.store.unloadRecord(line);
      this.controller.get('deliveryLines').removeObject(line);
    });
  },

My question is, should I write unit tests to cover it ?

After all, the function does not return anything, and does not have any side effects. Should I write unit tests to cover that the function is calling e.g. destroyRecord or unloadRecord ?




Aucun commentaire:

Enregistrer un commentaire