Skip to content

Commit

Permalink
Merge pull request #993 from meeber/refactor-expect-types
Browse files Browse the repository at this point in the history
refactor: `expectTypes` to access `ssfi` flag
  • Loading branch information
keithamus authored Jun 19, 2017
2 parents 351e968 + e7b2384 commit 9116bc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/chai/core/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ module.exports = function (chai, _) {
function include (val, msg) {
if (msg) flag(this, 'message', msg);

_.expectTypes(this, ['array', 'object', 'string'], flag(this, 'ssfi'));
_.expectTypes(this, ['array', 'object', 'string']);

var obj = flag(this, 'object')
, objType = _.type(obj).toLowerCase()
Expand Down
5 changes: 2 additions & 3 deletions lib/chai/utils/expectTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*
* @param {Mixed} obj constructed Assertion
* @param {Array} type A list of allowed types for this assertion
* @param {Function} ssfi starting point for removing implementation frames from
* stack trace of AssertionError
* @namespace Utils
* @name expectTypes
* @api public
Expand All @@ -24,8 +22,9 @@ var AssertionError = require('assertion-error');
var flag = require('./flag');
var type = require('type-detect');

module.exports = function expectTypes(obj, types, ssfi) {
module.exports = function expectTypes(obj, types) {
var flagMsg = flag(obj, 'message');
var ssfi = flag(obj, 'ssfi');

flagMsg = flagMsg ? flagMsg + ': ' : '';

Expand Down

0 comments on commit 9116bc8

Please sign in to comment.