Skip to content

Commit cfd3324

Browse files
committed
Reorganize some code for more accurate type checking by the closure compiler.
1 parent 411448f commit cfd3324

File tree

1 file changed

+20
-2
lines changed
  • javascript/node/selenium-webdriver/testing

1 file changed

+20
-2
lines changed

javascript/node/selenium-webdriver/testing/assert.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,23 @@ var base = require('../_base'),
3939
// PUBLIC API
4040

4141

42-
/** @type {webdriver.testing.assert.} */
43-
module.exports = assert;
42+
/**
43+
* Creates a new assertion.
44+
* @param {*} value The value to perform an assertion on.
45+
* @return {!webdriver.testing.Assertion} The new assertion.
46+
*/
47+
module.exports = function(value) {
48+
return assert(value);
49+
};
50+
51+
52+
/**
53+
* Registers a new assertion to expose from the
54+
* {@link webdriver.testing.Assertion} prototype.
55+
* @param {string} name The assertion name.
56+
* @param {(function(new: goog.labs.testing.Matcher, *)|
57+
* {matches: function(*): boolean,
58+
* describe: function(): string})} matcherTemplate Either the
59+
* matcher constructor to use, or an object literal defining a matcher.
60+
*/
61+
module.exports.register = assert.register;

0 commit comments

Comments
 (0)