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
) {};
31 QUnit
.Assert = function() {};
34 * @return {function():void}
36 QUnit
.Assert
.prototype.async = function() {};
41 * @param {string=} opt_desc
43 QUnit
.Assert
.prototype.notEqual = function(a
, b
, opt_desc
) {};
46 * @param {*} cond Passes if cond is truthy.
47 * @param {string=} desc
50 QUnit
.Assert
.prototype.ok = function(cond
, desc
) {};
55 * @param {string=} opt_message
57 QUnit
.Assert
.prototype.deepEqual = function(a
, b
, opt_message
) {};
62 * @param {string=} opt_message
64 QUnit
.Assert
.prototype.equal = function(a
, b
, opt_message
) {};
67 * @param {number} assertionCount
69 QUnit
.Assert
.prototype.expect = function(assertionCount
) {};
74 * @param {string=} opt_message
76 QUnit
.Assert
.prototype.strictEqual = function(a
, b
, opt_message
) {};
79 * @param {function()} a
81 * @param {string=} opt_message
83 QUnit
.Assert
.prototype.throws = function(a
, opt_b
, opt_message
) {};
87 * beforeEach: (function(!QUnit.Assert) | undefined),
88 * afterEach: (function(!QUnit.Assert) | undefined)
94 * @param {string} desc
95 * @param {QUnit.ModuleArgs=} opt_args=
97 QUnit
.module = function(desc
, opt_args
) {};
100 * @param {string} desc
101 * @param {function(!QUnit.Assert)} f
103 QUnit
.test = function(desc
, f
) {};