jeudi 21 avril 2016

Testing Mustache Templates with JavaScript/Jasmine

The Problem

My pair and I are debating and felt the SO community should weight in.

  1. Should we test our view (Mustache) templates?
  2. If so, how can we best test them?

What we have tried

Since, in the case of Mustache, our view templates are mostly logic-less we have chosen not to test them. However, we are starting to use inverted sections and functions where it seems we should be testing.

The tests we have written we render the view templates with dummy data, then use jQuery to assert the HTML contains the dummy data as expected.

The Question

Testing this way seems rather cumbersome and as such fails a cost/benefit analysis.

We are wondering if there is a better (faster or tools) way to test these view templates?

Aucun commentaire:

Enregistrer un commentaire