Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9116bc8

Browse files
authored
Merge pull request #993 from meeber/refactor-expect-types
refactor: `expectTypes` to access `ssfi` flag
2 parents 351e968 + e7b2384 commit 9116bc8

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/chai/core/assertions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ module.exports = function (chai, _) {
462462
function include (val, msg) {
463463
if (msg) flag(this, 'message', msg);
464464

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

467467
var obj = flag(this, 'object')
468468
, objType = _.type(obj).toLowerCase()

lib/chai/utils/expectTypes.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
*
1414
* @param {Mixed} obj constructed Assertion
1515
* @param {Array} type A list of allowed types for this assertion
16-
* @param {Function} ssfi starting point for removing implementation frames from
17-
* stack trace of AssertionError
1816
* @namespace Utils
1917
* @name expectTypes
2018
* @api public
@@ -24,8 +22,9 @@ var AssertionError = require('assertion-error');
2422
var flag = require('./flag');
2523
var type = require('type-detect');
2624

27-
module.exports = function expectTypes(obj, types, ssfi) {
25+
module.exports = function expectTypes(obj, types) {
2826
var flagMsg = flag(obj, 'message');
27+
var ssfi = flag(obj, 'ssfi');
2928

3029
flagMsg = flagMsg ? flagMsg + ': ' : '';
3130

0 commit comments

Comments
 (0)