Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
q.test("kind", function () {
q.expect(4);
q.ok(this.Foo1.classDoclet, "Foo1 has a class doclet");
q.strictEqual(this.Foo1.classDoclet.kind, "class", "Foo1 is a class");
q.ok(this.Foo2.classDoclet, "Foo2 has a class doclet");
q.strictEqual(this.Foo2.classDoclet.kind, "class", "Foo2 is a class");
});
q.test("tags", function () {
q.expect(2);
q.ok(this.Foo1.doclet.tags["returns"], "Foo1 has returns tag");
q.ok(this.Foo2.doclet.tags["returns"], "Foo2 has returns tag");
});
q.test("kind", function () {
q.expect(2);
q.strictEqual(this.Foo1.doclet.kind, "function", "Foo1 has function kind");
q.strictEqual(this.Foo2.doclet.kind, "function", "Foo2 has function kind");
});
q.test("author", function () {
q.expect(2);
help.tagsEqual(this.file.doclet.tags["author"], "name", ["John Smith"]);
});
q.test("name", function () {
q.expect(1);
q.strictEqual(this.file.name, "file.js", "has file name");
});
q.test("name", function () {
q.expect(4);
help.stringEqual(this.Foo1.name, "Foo1");
help.stringEqual(this.Foo2.name, "Foo2");
});
q.test("name", function () {
q.expect(4);
help.stringEqual(this.Foo1.name, "Foo1");
help.stringEqual(this.Foo2.name, "Foo2");
});
q.test("scope", function () {
q.expect(6);
q.ok(this.decls, "global decls");
q.strictEqual(Object.keys(this.decls).length, 2, "number of namespaces");
q.ok(this.Foo1, "Foo1 exists");
q.ok(this.Foo1 instanceof jfdoc.Scope, "Foo1 is a scope");
q.ok(this.Foo2, "Foo2 exists");
q.ok(this.Foo2 instanceof jfdoc.Scope, "Foo2 is a scope");
});
q.test("description", function () {
q.expect(6);
help.tagsEqual(this.params, "description", [
"Untyped parameter.",
"General description.",
"Typed parameter.",
"A function parameter. Multi-line description. Whitespace and\n" +
" punctuation in type.",
"Nested, matching braces in type. Multi-type parameter."]);
});
q.test("scope", function () {
q.expect(5);
q.strictEqual(Object.keys(this.decls).length, 2, "number of functions");
q.ok(this.Foo1, "Foo1 exists");
q.ok(this.Foo1 instanceof jfdoc.Scope, "Foo1 is a scope");
q.ok(this.Foo2, "Foo2 exists");
q.ok(this.Foo2 instanceof jfdoc.Scope, "Foo2 is a scope");
});