1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file contains various hacks needed to inform JSCompiler of various
6 // QUnit-specific properties and methods. It is used only with JSCompiler to
7 // verify the type-correctness of our code.
11 var QUnit = QUnit || {};
14 QUnit.Test = function() {};
16 /** @type {QUnit.Clock} */
17 QUnit.Test.prototype.clock = new QUnit.Clock();
20 QUnit.Clock = function() {};
22 /** @param {number} ticks */
23 QUnit.Clock.prototype.tick = function(ticks) {};
25 /** @param {Function} f */
26 QUnit.testStart = function(f) {};
28 /** @param {Function} f */
29 QUnit.testDone = function(f) {};
33 QUnit.Assert = function() {};
36 * @return {function():void}
38 QUnit.Assert.prototype.async = function() {};
43 * @param {string=} opt_desc
45 QUnit.Assert.prototype.notEqual = function(a, b, opt_desc) {};
48 * @param {*} cond Passes if cond is truthy.
49 * @param {string=} desc
52 QUnit.Assert.prototype.ok = function(cond, desc) {};
57 * @param {string=} opt_message
59 QUnit.Assert.prototype.deepEqual = function(a, b, opt_message) {};
64 * @param {string=} opt_message
66 QUnit.Assert.prototype.equal = function(a, b, opt_message) {};
69 * @param {number} assertionCount
71 QUnit.Assert.prototype.expect = function(assertionCount) {};
76 * @param {string=} opt_message
78 QUnit.Assert.prototype.strictEqual = function(a, b, opt_message) {};
81 * @param {function()} a
83 * @param {string=} opt_message
85 QUnit.Assert.prototype.throws = function(a, opt_b, opt_message) {};
89 * beforeEach: (function(!QUnit.Assert) | undefined),
90 * afterEach: (function(!QUnit.Assert) | undefined)
96 * @param {string} desc
97 * @param {QUnit.ModuleArgs=} opt_args=
99 QUnit.module = function(desc, opt_args) {};
102 * @param {string} desc
103 * @param {function(!QUnit.Assert)} f
105 QUnit.test = function(desc, f) {};
108 * @param {string} desc
109 * @param {function(!QUnit.Assert)} f
111 QUnit.skip = function(desc, f) {};