mirror of
https://github.com/chaijs/chai
synced 2024-11-15 08:17:14 +00:00
Fix type of actual checks.
This commit is contained in:
parent
567656290b
commit
5d6cd00ec0
1 changed files with 5 additions and 1 deletions
|
@ -47,6 +47,7 @@
|
||||||
|
|
||||||
var AssertionError = require('./error')
|
var AssertionError = require('./error')
|
||||||
, eql = require('./utils/eql')
|
, eql = require('./utils/eql')
|
||||||
|
, toString = Object.prototype.toString
|
||||||
, inspect = require('./utils/inspect');
|
, inspect = require('./utils/inspect');
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -72,6 +73,7 @@ function Assertion (obj, msg, stack) {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* ## Assertion.includeStack
|
* ## Assertion.includeStack
|
||||||
|
* , toString = Object.prototype.toString
|
||||||
*
|
*
|
||||||
* User configurable property, influences whether stack trace
|
* User configurable property, influences whether stack trace
|
||||||
* is included in Assertion error message. Default of false
|
* is included in Assertion error message. Default of false
|
||||||
|
@ -535,8 +537,10 @@ Assertion.prototype.within = function (start, finish) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Assertion.prototype.a = function (type) {
|
Assertion.prototype.a = function (type) {
|
||||||
|
var klass = type.charAt(0).toUpperCase() + type.slice(1);
|
||||||
|
|
||||||
this.assert(
|
this.assert(
|
||||||
type == typeof this.obj
|
'[object ' + klass + ']' === toString.call(this.obj)
|
||||||
, 'expected ' + this.inspect + ' to be a ' + type
|
, 'expected ' + this.inspect + ' to be a ' + type
|
||||||
, 'expected ' + this.inspect + ' not to be a ' + type);
|
, 'expected ' + this.inspect + ' not to be a ' + type);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue