mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 04:24:45 -04:00
Publish tests.
This commit is contained in:
parent
5a8ecd593d
commit
c396800dfa
40 changed files with 21478 additions and 1 deletions
20
test/util/chai.lengthOfKeys.js
Normal file
20
test/util/chai.lengthOfKeys.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
chai.Assertion.addChainableMethod('lengthOfKeys', function (count) {
|
||||
|
||||
var keyCount = _.keys(this._obj).length;
|
||||
|
||||
this.assert(
|
||||
keyCount === count,
|
||||
'expected ' + this._obj + ' to have ' + count + ' keys, but has ' + keyCount,
|
||||
'expected ' + this._obj + ' not to have ' + count + ' keys, but has ' + keyCount
|
||||
);
|
||||
});
|
||||
|
||||
chai.assert.lengthOfKeys = function (val, count, msg) {
|
||||
|
||||
new chai.Assertion(val, msg).to.be.lengthOfKeys(count);
|
||||
};
|
||||
|
||||
}());
|
Loading…
Add table
Add a link
Reference in a new issue