From 618a3c5a2c7e15efc7957dcb8c5da62526681dbc Mon Sep 17 00:00:00 2001
From: "FiveFilters.org" So finally you're testing your frontend JavaScript code? Great! The more you
+ So finally you're testing your frontend JavaScript code? Great! The more you
write tests, the more confident you are with your code… but how much precisely?
That's where code coverage might
help.
@@ -15,9 +16,9 @@ help. Drinking game for web devs:
-
(1) Think of a noun
-
(2) Google "<noun>.js"
-
(3) If a library with that name exists - drink
(1) Think of a noun
+
(2) Google "<noun>.js"
+
(3) If a library with that name exists - drink
Blanket.js is an easy to install, easy to configure,
@@ -105,13 +106,16 @@ describe("Cow", function() {
Notes: Running the tests now gives us something like this: Running the tests now gives us something like this:
-
+ data-cover
attribute we added to the script tag
+
+
data-cover
attribute we added to the script tag
loading the source of our library;
+
As you can see, the report at the bottom highlights that we haven't actually tested the case where an error is raised in case a target name is missing. We've been informed of that, nothing more, nothing less. We simply know -- cgit v1.2.3