How to use the qunit.expect function in qunit

To help you get started, we’ve selected a few qunit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thejohnfreeman / jfdoc / test / cases / class.js View on Github external
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");
  });
github thejohnfreeman / jfdoc / test / cases / returns.js View on Github external
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");
  });
github thejohnfreeman / jfdoc / test / cases / function.js View on Github external
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");
  });
github thejohnfreeman / jfdoc / test / cases / file.js View on Github external
q.test("author", function () {
    q.expect(2);
    help.tagsEqual(this.file.doclet.tags["author"], "name", ["John Smith"]);
  });
github thejohnfreeman / jfdoc / test / cases / file.js View on Github external
q.test("name", function () {
    q.expect(1);
    q.strictEqual(this.file.name, "file.js", "has file name");
  });
github thejohnfreeman / jfdoc / test / cases / function.js View on Github external
q.test("name", function () {
    q.expect(4);
    help.stringEqual(this.Foo1.name, "Foo1");
    help.stringEqual(this.Foo2.name, "Foo2");
  });
github thejohnfreeman / jfdoc / test / cases / namespace.js View on Github external
q.test("name", function () {
    q.expect(4);
    help.stringEqual(this.Foo1.name, "Foo1");
    help.stringEqual(this.Foo2.name, "Foo2");
  });
github thejohnfreeman / jfdoc / test / cases / namespace.js View on Github external
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");
  });
github thejohnfreeman / jfdoc / test / cases / param.js View on Github external
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."]);
  });
github thejohnfreeman / jfdoc / test / cases / function.js View on Github external
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");
  });