OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 var sinon = sinon || {}; |
| 6 |
| 7 /** @type {Object} */ |
| 8 sinon.assert = {}; |
| 9 |
| 10 /** |
| 11 * @param {(sinon.Spy|Function)} f |
| 12 */ |
| 13 sinon.assert.called = function(f) {}; |
| 14 |
| 15 /** |
| 16 * @param {(sinon.Spy|Function)} f |
| 17 */ |
| 18 sinon.assert.calledOnce = function(f) {}; |
| 19 |
| 20 /** |
| 21 * @param {(sinon.Spy|Function)} f |
| 22 * @param {...} data |
| 23 */ |
| 24 sinon.assert.calledWith = function(f, data) {}; |
| 25 |
| 26 /** |
| 27 * @param {(sinon.Spy|Function)} f |
| 28 */ |
| 29 sinon.assert.notCalled = function(f) {}; |
| 30 |
| 31 /** @constructor */ |
| 32 sinon.Expectation = function() {}; |
| 33 |
| 34 /** @return {sinon.Expectation} */ |
| 35 sinon.Expectation.prototype.once = function() {}; |
| 36 |
| 37 /** |
| 38 * @param {...} data |
| 39 * @return {sinon.Expectation} |
| 40 */ |
| 41 sinon.Expectation.prototype.withArgs = function(data) {}; |
| 42 |
| 43 /** @return {boolean} */ |
| 44 sinon.Expectation.prototype.verify = function() {}; |
| 45 |
| 46 /** @param {...} data */ |
| 47 sinon.Expectation.prototype.returns = function(data) {}; |
| 48 |
| 49 /** |
| 50 * @param {Object} obj |
| 51 * @return {sinon.Mock} |
| 52 */ |
| 53 sinon.mock = function(obj) {}; |
| 54 |
| 55 /** @constructor */ |
| 56 sinon.Mock = function() {}; |
| 57 |
| 58 /** |
| 59 * @param {string} method |
| 60 * @return {sinon.Expectation} |
| 61 */ |
| 62 sinon.Mock.prototype.expects = function(method) {}; |
| 63 |
| 64 /** @type {function(...):Function} */ |
| 65 sinon.spy = function() {}; |
| 66 |
| 67 /** |
| 68 * This is a jscompile type that can be OR'ed with the actual type to make |
| 69 * jscompile aware of the sinon.spy functions that are added to the base |
| 70 * type. |
| 71 * Example: Instead of specifying a type of |
| 72 * {function():void} |
| 73 * the following can be used to add the sinon.spy functions: |
| 74 * {(sinon.Spy|function():void)} |
| 75 * |
| 76 * @constructor |
| 77 */ |
| 78 sinon.Spy = function() {}; |
| 79 |
| 80 /** @type {number} */ |
| 81 sinon.Spy.prototype.callCount; |
| 82 |
| 83 /** @type {boolean} */ |
| 84 sinon.Spy.prototype.called = false; |
| 85 |
| 86 /** @type {function(...):boolean} */ |
| 87 sinon.Spy.prototype.calledWith = function() {}; |
| 88 |
| 89 /** @type {function(number):{args:Array}} */ |
| 90 sinon.Spy.prototype.getCall = function(index) {}; |
| 91 |
| 92 sinon.Spy.prototype.reset = function() {}; |
| 93 |
| 94 /** |
| 95 * @param {Object} obj |
| 96 * @param {string} method |
| 97 * @return {sinon.TestStub} |
| 98 */ |
| 99 sinon.stub = function(obj, method) {}; |
| 100 |
| 101 /** @constructor */ |
| 102 sinon.TestStub = function() {}; |
| 103 |
| 104 /** @type {function(number):{args:Array}} */ |
| 105 sinon.TestStub.prototype.getCall = function(index) {}; |
| 106 |
| 107 sinon.TestStub.prototype.restore = function() {}; |
| 108 |
| 109 /** @param {*} a */ |
| 110 sinon.TestStub.prototype.returns = function(a) {}; |
| 111 |
| 112 /** @type {function(string, (string|Array<string>)=):sinon.Expectation} */ |
| 113 sinon.TestStub.prototype.withArgs = function(messageName, opt_args) {}; |
OLD | NEW |