]> Lady’s Gitweb - Etiquette/blobdiff - model.test.js
Return undefined not null when resolving fails
[Etiquette] / model.test.js
index a92671c52d2a4a033ab575172ff6abe7e00f2117..ed1430e8a49246c1a97190eb3e64ca9e443bbad3 100644 (file)
@@ -183,12 +183,12 @@ describe("TagSystem", () => {
         assertStrictEquals(retrieved.identifier, identifier);
       });
 
-      it("[[Call]] returns null if no tag with the given I·R·I has been persisted", () => {
+      it("[[Call]] returns undefined if no tag with the given I·R·I has been persisted", () => {
         assertStrictEquals(
           Tag.fromIRI(
             `https://${system.authorityName}/tag:${system.taggingEntity}:000-0000`,
           ),
-          null,
+          undefined,
         );
       });
 
@@ -212,8 +212,8 @@ describe("TagSystem", () => {
         assertStrictEquals(retrieved.identifier, identifier);
       });
 
-      it("[[Call]] returns null if no tag with the given identifier has been persisted", () => {
-        assertStrictEquals(Tag.fromIdentifier("000-0000"), null);
+      it("[[Call]] returns undefined if no tag with the given identifier has been persisted", () => {
+        assertStrictEquals(Tag.fromIdentifier("000-0000"), undefined);
       });
 
       it("[[Call]] throws if passed an invalid identifier", () => {
@@ -239,14 +239,14 @@ describe("TagSystem", () => {
         assertStrictEquals(retrieved.identifier, identifier);
       });
 
-      it("[[Call]] returns null if no tag with the given Tag U·R·I has been persisted", () => {
+      it("[[Call]] returns undefined if no tag with the given Tag U·R·I has been persisted", () => {
         assertStrictEquals(
           Tag.fromTagURI(`tag:${system.taggingEntity}:`),
-          null,
+          undefined,
         );
         assertStrictEquals(
           Tag.fromTagURI(`tag:${system.taggingEntity}:000-0000`),
-          null,
+          undefined,
         );
       });
 
This page took 0.02298 seconds and 4 git commands to generate.