Skip to content

Commit

Permalink
Define "when passed as parameters to" for array-like instead of array.
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Apr 12, 2015
1 parent 909e94d commit e56f6a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/assertions.js
Expand Up @@ -837,7 +837,7 @@ module.exports = function (expect) {
return new ProxyConstructor();
}

expect.addAssertion('array', [
expect.addAssertion('array-like', [
'when passed as parameters to [async]',
'when passed as parameters to [constructor]'
], function (expect, subject, fn) { // ...
Expand Down
8 changes: 8 additions & 0 deletions test/unexpected.spec.js
Expand Up @@ -4779,6 +4779,14 @@ describe('unexpected', function () {
expect([3, 4], 'when passed as parameters to', add, 'to equal', 7);
});

it('works with an array-like object', function () {
var args;
(function () {
args = arguments;
}(3, 4));
expect(args, 'when passed as parameters to', add, 'to equal', 7);
});

it('should produce a nested error message when the assertion fails', function () {
expect(function () {
expect([3, 4], 'when passed as parameters to', add, 'to equal', 8);
Expand Down

0 comments on commit e56f6a4

Please sign in to comment.