The problems: 1. When trying to check that one object doesn't hold a reference to another, if you use referencesVia, you get an error message on stdout. :-P 2. Oh and your test will magically fail in opt builds (oops). ---- So maybe the API should be like this instead: // Throw an Error unless the given edge exists. assertHasReference(source, edgeName, target); // Throw an Error if target is reachable from source, // even indirectly. assertHasNoReference(source, target); The latter may have to ignore the parent reference in order to get sane results. Both do nothing when findReferences isn't available.
Maybe also the prototype reference. I think it's ok for it to be a little ad-hoc.