summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/unittests/sinon_helpers.js
blob: bfea6cc001b98829757b0ef56755a06260557b46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * Casts an |object| to sinon.TestStub verifying that it's really a stub.
 * @return {sinon.TestStub}
 */
function $testStub(/** Object */ object) {
  console.assert(object.hasOwnProperty("getCall"),
                 'Object is not a stub', object);
  return /** @type {sinon.TestStub} */ (object);
};