});
});
+ describe(".constructor", () => {
+ it("[[Get]] is `Function`", () => {
+ assertStrictEquals(Tag.constructor, Function);
+ });
+ });
+
describe(".fromIRI", () => {
it("[[Call]] returns the persisted tag with the given I·R·I", () => {
const tag = new Tag();
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,
);
});
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", () => {
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,
);
});
});
});
- describe(".getSystem", () => {
- it("[[Has]] is not present", () => {
- assertFalse("getSystem" in Tag);
- });
- });
-
describe(".identifiers", () => {
it("[[Call]] yields all the persisted identifiers", () => {
const tags = new Set(function* () {
});
it("[[Call]] throws when this is not a tag which can be placed in canon", () => {
+ const canon = new Tag("CanonTag");
+ canon.persist();
assertThrows(() => {
- new Tag().addInCanonTag();
+ new Tag().addInCanonTag(canon);
});
});
});
it("[[Call]] throws when this is not a conceptual tag", () => {
+ const involved = new Tag();
+ involved.persist();
assertThrows(() => {
- new Tag().addInvolvesTag();
+ new Tag().addInvolvesTag(involved);
});
});