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("name", function () {
q.expect(1);
q.strictEqual(this.file.name, "file.js", "has file name");
});
q.test("kind", function () {
q.expect(2);
q.strictEqual(this.Foo1.doclet.kind, "namespace",
"Foo1 has namespace kind");
q.strictEqual(this.Foo2.doclet.kind, "namespace",
"Foo2 has namespace kind");
});
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("kind", function () {
q.expect(2);
q.strictEqual(this.Foo1.doclet.kind, "namespace",
"Foo1 has namespace kind");
q.strictEqual(this.Foo2.doclet.kind, "namespace",
"Foo2 has namespace kind");
});
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("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("scope", function () {
q.expect(5);
q.strictEqual(Object.keys(this.decls).length, 2, "number of constructors");
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");
});
exports.tagsEqual = function tagsEqual(tags, field, values) {
q.strictEqual(tags.length, values.length, "number of tags");
values.forEach(function (value, i) {
q.strictEqual(tags[i][field], value, field + " of tag[" + i + "]");
});
};
values.forEach(function (value, i) {
q.strictEqual(tags[i][field], value, field + " of tag[" + i + "]");
});
};
exports.stringEqual = function stringEqual(actual, expected) {
q.strictEqual(actual, expected, "matches without trimming");
q.strictEqual(actual.trim(), expected, "matches with trimming");
};