chai 4.1.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,9 +4,7 @@
4
4
  * MIT Licensed
5
5
  */
6
6
 
7
-
8
7
  module.exports = function (chai, util) {
9
-
10
8
  /*!
11
9
  * Chai dependencies.
12
10
  */
@@ -43,10 +41,18 @@ module.exports = function (chai, util) {
43
41
  };
44
42
 
45
43
  /**
44
+ * ### .fail([message])
46
45
  * ### .fail(actual, expected, [message], [operator])
47
46
  *
48
47
  * Throw a failure. Node.js `assert` module-compatible.
49
48
  *
49
+ * assert.fail();
50
+ * assert.fail("custom error message");
51
+ * assert.fail(1, 2);
52
+ * assert.fail(1, 2, "custom error message");
53
+ * assert.fail(1, 2, "custom error message", ">");
54
+ * assert.fail(1, 2, undefined, ">");
55
+ *
50
56
  * @name fail
51
57
  * @param {Mixed} actual
52
58
  * @param {Mixed} expected
@@ -57,6 +63,13 @@ module.exports = function (chai, util) {
57
63
  */
58
64
 
59
65
  assert.fail = function (actual, expected, message, operator) {
66
+ if (arguments.length < 2) {
67
+ // Comply with Node's fail([message]) interface
68
+
69
+ message = actual;
70
+ actual = undefined;
71
+ }
72
+
60
73
  message = message || 'assert.fail()';
61
74
  throw new chai.AssertionError(message, {
62
75
  actual: actual
@@ -906,7 +919,7 @@ module.exports = function (chai, util) {
906
919
  * an array, the array is searched for an element that's strictly equal to the
907
920
  * given value. When asserting a subset of properties in an object, the object
908
921
  * is searched for the given property keys, checking that each one is present
909
- * and stricty equal to the given property value. For instance:
922
+ * and strictly equal to the given property value. For instance:
910
923
  *
911
924
  * var obj1 = {a: 1}
912
925
  * , obj2 = {b: 2};
@@ -933,8 +946,8 @@ module.exports = function (chai, util) {
933
946
  * the absence of a value in an array, a substring in a string, or a subset of
934
947
  * properties in an object.
935
948
  *
936
- * assert.notInclude([1,2,3], 4, 'array doesn't contain value');
937
- * assert.notInclude('foobar', 'baz', 'string doesn't contain substring');
949
+ * assert.notInclude([1,2,3], 4, "array doesn't contain value");
950
+ * assert.notInclude('foobar', 'baz', "string doesn't contain substring");
938
951
  * assert.notInclude({ foo: 'bar', hello: 'universe' }, { foo: 'baz' }, 'object doesn't contain property');
939
952
  *
940
953
  * Strict equality (===) is used. When asserting the absence of a value in an
@@ -1014,24 +1027,24 @@ module.exports = function (chai, util) {
1014
1027
 
1015
1028
  /**
1016
1029
  * ### .nestedInclude(haystack, needle, [message])
1017
- *
1018
- * Asserts that 'haystack' includes 'needle'.
1019
- * Can be used to assert the inclusion of a subset of properties in an
1030
+ *
1031
+ * Asserts that 'haystack' includes 'needle'.
1032
+ * Can be used to assert the inclusion of a subset of properties in an
1020
1033
  * object.
1021
- * Enables the use of dot- and bracket-notation for referencing nested
1034
+ * Enables the use of dot- and bracket-notation for referencing nested
1022
1035
  * properties.
1023
1036
  * '[]' and '.' in property names can be escaped using double backslashes.
1024
- *
1037
+ *
1025
1038
  * assert.nestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'x'});
1026
1039
  * assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'x'});
1027
- *
1040
+ *
1028
1041
  * @name nestedInclude
1029
1042
  * @param {Object} haystack
1030
1043
  * @param {Object} needle
1031
1044
  * @param {String} message
1032
1045
  * @namespace Assert
1033
- * @api public
1034
- */
1046
+ * @api public
1047
+ */
1035
1048
 
1036
1049
  assert.nestedInclude = function (exp, inc, msg) {
1037
1050
  new Assertion(exp, msg, assert.nestedInclude, true).nested.include(inc);
@@ -1039,24 +1052,24 @@ module.exports = function (chai, util) {
1039
1052
 
1040
1053
  /**
1041
1054
  * ### .notNestedInclude(haystack, needle, [message])
1042
- *
1043
- * Asserts that 'haystack' does not include 'needle'.
1044
- * Can be used to assert the absence of a subset of properties in an
1055
+ *
1056
+ * Asserts that 'haystack' does not include 'needle'.
1057
+ * Can be used to assert the absence of a subset of properties in an
1045
1058
  * object.
1046
- * Enables the use of dot- and bracket-notation for referencing nested
1047
- * properties.
1059
+ * Enables the use of dot- and bracket-notation for referencing nested
1060
+ * properties.
1048
1061
  * '[]' and '.' in property names can be escaped using double backslashes.
1049
- *
1062
+ *
1050
1063
  * assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\.a.b': 'y'});
1051
1064
  * assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'y'});
1052
- *
1065
+ *
1053
1066
  * @name notNestedInclude
1054
1067
  * @param {Object} haystack
1055
1068
  * @param {Object} needle
1056
1069
  * @param {String} message
1057
1070
  * @namespace Assert
1058
- * @api public
1059
- */
1071
+ * @api public
1072
+ */
1060
1073
 
1061
1074
  assert.notNestedInclude = function (exp, inc, msg) {
1062
1075
  new Assertion(exp, msg, assert.notNestedInclude, true)
@@ -1065,23 +1078,23 @@ module.exports = function (chai, util) {
1065
1078
 
1066
1079
  /**
1067
1080
  * ### .deepNestedInclude(haystack, needle, [message])
1068
- *
1081
+ *
1069
1082
  * Asserts that 'haystack' includes 'needle'.
1070
- * Can be used to assert the inclusion of a subset of properties in an
1083
+ * Can be used to assert the inclusion of a subset of properties in an
1071
1084
  * object while checking for deep equality.
1072
- * Enables the use of dot- and bracket-notation for referencing nested
1085
+ * Enables the use of dot- and bracket-notation for referencing nested
1073
1086
  * properties.
1074
1087
  * '[]' and '.' in property names can be escaped using double backslashes.
1075
- *
1088
+ *
1076
1089
  * assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}});
1077
1090
  * assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}});
1078
- *
1091
+ *
1079
1092
  * @name deepNestedInclude
1080
1093
  * @param {Object} haystack
1081
1094
  * @param {Object} needle
1082
1095
  * @param {String} message
1083
1096
  * @namespace Assert
1084
- * @api public
1097
+ * @api public
1085
1098
  */
1086
1099
 
1087
1100
  assert.deepNestedInclude = function(exp, inc, msg) {
@@ -1091,23 +1104,23 @@ module.exports = function (chai, util) {
1091
1104
 
1092
1105
  /**
1093
1106
  * ### .notDeepNestedInclude(haystack, needle, [message])
1094
- *
1107
+ *
1095
1108
  * Asserts that 'haystack' does not include 'needle'.
1096
- * Can be used to assert the absence of a subset of properties in an
1109
+ * Can be used to assert the absence of a subset of properties in an
1097
1110
  * object while checking for deep equality.
1098
- * Enables the use of dot- and bracket-notation for referencing nested
1111
+ * Enables the use of dot- and bracket-notation for referencing nested
1099
1112
  * properties.
1100
1113
  * '[]' and '.' in property names can be escaped using double backslashes.
1101
- *
1114
+ *
1102
1115
  * assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}})
1103
1116
  * assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}});
1104
- *
1117
+ *
1105
1118
  * @name notDeepNestedInclude
1106
1119
  * @param {Object} haystack
1107
1120
  * @param {Object} needle
1108
1121
  * @param {String} message
1109
1122
  * @namespace Assert
1110
- * @api public
1123
+ * @api public
1111
1124
  */
1112
1125
 
1113
1126
  assert.notDeepNestedInclude = function(exp, inc, msg) {
@@ -1117,13 +1130,13 @@ module.exports = function (chai, util) {
1117
1130
 
1118
1131
  /**
1119
1132
  * ### .ownInclude(haystack, needle, [message])
1120
- *
1133
+ *
1121
1134
  * Asserts that 'haystack' includes 'needle'.
1122
- * Can be used to assert the inclusion of a subset of properties in an
1135
+ * Can be used to assert the inclusion of a subset of properties in an
1123
1136
  * object while ignoring inherited properties.
1124
- *
1137
+ *
1125
1138
  * assert.ownInclude({ a: 1 }, { a: 1 });
1126
- *
1139
+ *
1127
1140
  * @name ownInclude
1128
1141
  * @param {Object} haystack
1129
1142
  * @param {Object} needle
@@ -1138,15 +1151,15 @@ module.exports = function (chai, util) {
1138
1151
 
1139
1152
  /**
1140
1153
  * ### .notOwnInclude(haystack, needle, [message])
1141
- *
1154
+ *
1142
1155
  * Asserts that 'haystack' includes 'needle'.
1143
- * Can be used to assert the absence of a subset of properties in an
1156
+ * Can be used to assert the absence of a subset of properties in an
1144
1157
  * object while ignoring inherited properties.
1145
- *
1158
+ *
1146
1159
  * Object.prototype.b = 2;
1147
- *
1160
+ *
1148
1161
  * assert.notOwnInclude({ a: 1 }, { b: 2 });
1149
- *
1162
+ *
1150
1163
  * @name notOwnInclude
1151
1164
  * @param {Object} haystack
1152
1165
  * @param {Object} needle
@@ -1161,13 +1174,13 @@ module.exports = function (chai, util) {
1161
1174
 
1162
1175
  /**
1163
1176
  * ### .deepOwnInclude(haystack, needle, [message])
1164
- *
1177
+ *
1165
1178
  * Asserts that 'haystack' includes 'needle'.
1166
- * Can be used to assert the inclusion of a subset of properties in an
1179
+ * Can be used to assert the inclusion of a subset of properties in an
1167
1180
  * object while ignoring inherited properties and checking for deep equality.
1168
- *
1181
+ *
1169
1182
  * assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}});
1170
- *
1183
+ *
1171
1184
  * @name deepOwnInclude
1172
1185
  * @param {Object} haystack
1173
1186
  * @param {Object} needle
@@ -1183,13 +1196,13 @@ module.exports = function (chai, util) {
1183
1196
 
1184
1197
  /**
1185
1198
  * ### .notDeepOwnInclude(haystack, needle, [message])
1186
- *
1199
+ *
1187
1200
  * Asserts that 'haystack' includes 'needle'.
1188
- * Can be used to assert the absence of a subset of properties in an
1201
+ * Can be used to assert the absence of a subset of properties in an
1189
1202
  * object while ignoring inherited properties and checking for deep equality.
1190
- *
1203
+ *
1191
1204
  * assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}});
1192
- *
1205
+ *
1193
1206
  * @name notDeepOwnInclude
1194
1207
  * @param {Object} haystack
1195
1208
  * @param {Object} needle
@@ -1651,10 +1664,12 @@ module.exports = function (chai, util) {
1651
1664
  /**
1652
1665
  * ### .lengthOf(object, length, [message])
1653
1666
  *
1654
- * Asserts that `object` has a `length` property with the expected value.
1667
+ * Asserts that `object` has a `length` or `size` with the expected value.
1655
1668
  *
1656
1669
  * assert.lengthOf([1,2,3], 3, 'array has length of 3');
1657
1670
  * assert.lengthOf('foobar', 6, 'string has length of 6');
1671
+ * assert.lengthOf(new Set([1,2,3]), 3, 'set has size of 3');
1672
+ * assert.lengthOf(new Map([['a',1],['b',2],['c',3]]), 3, 'map has size of 3');
1658
1673
  *
1659
1674
  * @name lengthOf
1660
1675
  * @param {Mixed} object
@@ -1675,10 +1690,10 @@ module.exports = function (chai, util) {
1675
1690
  * You can also provide a single object instead of a `keys` array and its keys
1676
1691
  * will be used as the expected set of keys.
1677
1692
  *
1678
- * assert.hasAnyKey({foo: 1, bar: 2, baz: 3}, ['foo', 'iDontExist', 'baz']);
1679
- * assert.hasAnyKey({foo: 1, bar: 2, baz: 3}, {foo: 30, iDontExist: 99, baz: 1337]);
1680
- * assert.hasAnyKey(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'thisKeyDoesNotExist']);
1681
- * assert.hasAnyKey(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}, 'thisKeyDoesNotExist']);
1693
+ * assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'iDontExist', 'baz']);
1694
+ * assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, iDontExist: 99, baz: 1337});
1695
+ * assert.hasAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']);
1696
+ * assert.hasAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']);
1682
1697
  *
1683
1698
  * @name hasAnyKeys
1684
1699
  * @param {Mixed} object
@@ -1811,7 +1826,7 @@ module.exports = function (chai, util) {
1811
1826
  * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {three: 'three'}]);
1812
1827
  * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]);
1813
1828
  *
1814
- * @name doesNotHaveAllKeys
1829
+ * @name hasAnyDeepKeys
1815
1830
  * @param {Mixed} object
1816
1831
  * @param {Array|Object} keys
1817
1832
  * @param {String} message
@@ -1942,8 +1957,8 @@ module.exports = function (chai, util) {
1942
1957
  * If `errMsgMatcher` is provided, it also asserts that the error thrown will have a
1943
1958
  * message matching `errMsgMatcher`.
1944
1959
  *
1945
- * assert.throws(fn, 'function throws a reference error');
1946
- * assert.throws(fn, /function throws a reference error/);
1960
+ * assert.throws(fn, 'Error thrown must have this msg');
1961
+ * assert.throws(fn, /Error thrown must have a msg that matches this/);
1947
1962
  * assert.throws(fn, ReferenceError);
1948
1963
  * assert.throws(fn, errorInstance);
1949
1964
  * assert.throws(fn, ReferenceError, 'Error thrown must be a ReferenceError and have this msg');
@@ -10,10 +10,18 @@ module.exports = function (chai, util) {
10
10
  };
11
11
 
12
12
  /**
13
+ * ### .fail([message])
13
14
  * ### .fail(actual, expected, [message], [operator])
14
15
  *
15
16
  * Throw a failure.
16
17
  *
18
+ * expect.fail();
19
+ * expect.fail("custom error message");
20
+ * expect.fail(1, 2);
21
+ * expect.fail(1, 2, "custom error message");
22
+ * expect.fail(1, 2, "custom error message", ">");
23
+ * expect.fail(1, 2, undefined, ">");
24
+ *
17
25
  * @name fail
18
26
  * @param {Mixed} actual
19
27
  * @param {Mixed} expected
@@ -24,6 +32,11 @@ module.exports = function (chai, util) {
24
32
  */
25
33
 
26
34
  chai.expect.fail = function (actual, expected, message, operator) {
35
+ if (arguments.length < 2) {
36
+ message = actual;
37
+ actual = undefined;
38
+ }
39
+
27
40
  message = message || 'expect.fail()';
28
41
  throw new chai.AssertionError(message, {
29
42
  actual: actual
@@ -13,7 +13,8 @@ module.exports = function (chai, util) {
13
13
  if (this instanceof String
14
14
  || this instanceof Number
15
15
  || this instanceof Boolean
16
- || typeof Symbol === 'function' && this instanceof Symbol) {
16
+ || typeof Symbol === 'function' && this instanceof Symbol
17
+ || typeof BigInt === 'function' && this instanceof BigInt) {
17
18
  return new Assertion(this.valueOf(), null, shouldGetter);
18
19
  }
19
20
  return new Assertion(this, null, shouldGetter);
@@ -42,10 +43,19 @@ module.exports = function (chai, util) {
42
43
  var should = {};
43
44
 
44
45
  /**
46
+ * ### .fail([message])
45
47
  * ### .fail(actual, expected, [message], [operator])
46
48
  *
47
49
  * Throw a failure.
48
50
  *
51
+ * should.fail();
52
+ * should.fail("custom error message");
53
+ * should.fail(1, 2);
54
+ * should.fail(1, 2, "custom error message");
55
+ * should.fail(1, 2, "custom error message", ">");
56
+ * should.fail(1, 2, undefined, ">");
57
+ *
58
+ *
49
59
  * @name fail
50
60
  * @param {Mixed} actual
51
61
  * @param {Mixed} expected
@@ -56,6 +66,11 @@ module.exports = function (chai, util) {
56
66
  */
57
67
 
58
68
  should.fail = function (actual, expected, message, operator) {
69
+ if (arguments.length < 2) {
70
+ message = actual;
71
+ actual = undefined;
72
+ }
73
+
59
74
  message = message || 'should.fail()';
60
75
  throw new chai.AssertionError(message, {
61
76
  actual: actual
@@ -1,5 +1,3 @@
1
- var config = require('../config');
2
-
3
1
  var fnLengthDesc = Object.getOwnPropertyDescriptor(function () {}, 'length');
4
2
 
5
3
  /*!
@@ -36,7 +36,7 @@ var transferFlags = require('./transferFlags');
36
36
  */
37
37
 
38
38
  module.exports = function addProperty(ctx, name, getter) {
39
- getter = getter === undefined ? new Function() : getter;
39
+ getter = getter === undefined ? function () {} : getter;
40
40
 
41
41
  Object.defineProperty(ctx, name,
42
42
  { get: function propertyGetter() {
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  /*!
8
- * Module dependancies
8
+ * Module dependencies
9
9
  */
10
10
 
11
11
  var inspect = require('./inspect');
@@ -20,7 +20,7 @@ var inspect = require('./inspect');
20
20
  *
21
21
  * @param {Mixed} first element to compare
22
22
  * @param {Mixed} second element to compare
23
- * @returns {Number} -1 if 'a' should come before 'b'; otherwise 1
23
+ * @returns {Number} -1 if 'a' should come before 'b'; otherwise 1
24
24
  * @name compareByInspect
25
25
  * @namespace Utils
26
26
  * @api public
@@ -5,12 +5,11 @@
5
5
  */
6
6
 
7
7
  /*!
8
- * Module dependancies
8
+ * Module dependencies
9
9
  */
10
10
 
11
11
  var flag = require('./flag')
12
12
  , getActual = require('./getActual')
13
- , inspect = require('./inspect')
14
13
  , objDisplay = require('./objDisplay');
15
14
 
16
15
  /**
@@ -0,0 +1,55 @@
1
+ var type = require('type-detect');
2
+
3
+ var flag = require('./flag');
4
+
5
+ function isObjectType(obj) {
6
+ var objectType = type(obj);
7
+ var objectTypes = ['Array', 'Object', 'function'];
8
+
9
+ return objectTypes.indexOf(objectType) !== -1;
10
+ }
11
+
12
+ /**
13
+ * ### .getOperator(message)
14
+ *
15
+ * Extract the operator from error message.
16
+ * Operator defined is based on below link
17
+ * https://nodejs.org/api/assert.html#assert_assert.
18
+ *
19
+ * Returns the `operator` or `undefined` value for an Assertion.
20
+ *
21
+ * @param {Object} object (constructed Assertion)
22
+ * @param {Arguments} chai.Assertion.prototype.assert arguments
23
+ * @namespace Utils
24
+ * @name getOperator
25
+ * @api public
26
+ */
27
+
28
+ module.exports = function getOperator(obj, args) {
29
+ var operator = flag(obj, 'operator');
30
+ var negate = flag(obj, 'negate');
31
+ var expected = args[3];
32
+ var msg = negate ? args[2] : args[1];
33
+
34
+ if (operator) {
35
+ return operator;
36
+ }
37
+
38
+ if (typeof msg === 'function') msg = msg();
39
+
40
+ msg = msg || '';
41
+ if (!msg) {
42
+ return undefined;
43
+ }
44
+
45
+ if (/\shave\s/.test(msg)) {
46
+ return undefined;
47
+ }
48
+
49
+ var isObject = isObjectType(expected);
50
+ if (/\snot\s/.test(msg)) {
51
+ return isObject ? 'notDeepStrictEqual' : 'notStrictEqual';
52
+ }
53
+
54
+ return isObject ? 'deepStrictEqual' : 'strictEqual';
55
+ };
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  /*!
8
- * Module dependancies
8
+ * Module dependencies
9
9
  */
10
10
 
11
11
  var getOwnEnumerablePropertySymbols = require('./getOwnEnumerablePropertySymbols');
@@ -170,3 +170,9 @@ exports.isProxyEnabled = require('./isProxyEnabled');
170
170
  */
171
171
 
172
172
  exports.isNaN = require('./isNaN');
173
+
174
+ /*!
175
+ * getOperator method
176
+ */
177
+
178
+ exports.getOperator = require('./getOperator');
@@ -105,7 +105,7 @@ function formatValue(ctx, value, recurseTimes) {
105
105
 
106
106
  var name, nameSuffix;
107
107
 
108
- // Some type of object without properties can be shortcutted.
108
+ // Some type of object without properties can be shortcut.
109
109
  // In IE, errors have a single `stack` property, or if they are vanilla `Error`,
110
110
  // a `stack` plus `description` property; ignore those for consistency.
111
111
  if (keys.length === 0 || (isError(value) && (
@@ -196,7 +196,6 @@ function formatValue(ctx, value, recurseTimes) {
196
196
  return reduceToSingleString(output, base, braces);
197
197
  }
198
198
 
199
-
200
199
  function formatPrimitive(ctx, value) {
201
200
  switch (typeof value) {
202
201
  case 'undefined':
@@ -226,12 +225,10 @@ function formatPrimitive(ctx, value) {
226
225
  }
227
226
  }
228
227
 
229
-
230
228
  function formatError(value) {
231
229
  return '[' + Error.prototype.toString.call(value) + ']';
232
230
  }
233
231
 
234
-
235
232
  function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
236
233
  var output = [];
237
234
  for (var i = 0, l = value.length; i < l; ++i) {
@@ -334,12 +331,8 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
334
331
  return name + ': ' + str;
335
332
  }
336
333
 
337
-
338
334
  function reduceToSingleString(output, base, braces) {
339
- var numLinesEst = 0;
340
335
  var length = output.reduce(function(prev, cur) {
341
- numLinesEst++;
342
- if (cur.indexOf('\n') >= 0) numLinesEst++;
343
336
  return prev + cur.length + 1;
344
337
  }, 0);
345
338
 
@@ -18,7 +18,7 @@ var config = require('../config');
18
18
  */
19
19
 
20
20
  module.exports = function isProxyEnabled() {
21
- return config.useProxy &&
21
+ return config.useProxy &&
22
22
  typeof Proxy !== 'undefined' &&
23
23
  typeof Reflect !== 'undefined';
24
24
  };
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  /*!
8
- * Module dependancies
8
+ * Module dependencies
9
9
  */
10
10
 
11
11
  var inspect = require('./inspect');
@@ -10,7 +10,7 @@ var transferFlags = require('./transferFlags');
10
10
  /**
11
11
  * ### .overwriteChainableMethod(ctx, name, method, chainingBehavior)
12
12
  *
13
- * Overwites an already existing chainable method
13
+ * Overwrites an already existing chainable method
14
14
  * and provides access to the previous function or
15
15
  * property. Must return functions to be used for
16
16
  * name.
@@ -13,7 +13,7 @@ var transferFlags = require('./transferFlags');
13
13
  /**
14
14
  * ### .overwriteMethod(ctx, name, fn)
15
15
  *
16
- * Overwites an already existing method and provides
16
+ * Overwrites an already existing method and provides
17
17
  * access to previous function. Must return function
18
18
  * to be used for name.
19
19
  *
@@ -12,7 +12,7 @@ var transferFlags = require('./transferFlags');
12
12
  /**
13
13
  * ### .overwriteProperty(ctx, name, fn)
14
14
  *
15
- * Overwites an already existing property getter and provides
15
+ * Overwrites an already existing property getter and provides
16
16
  * access to previous value. Must return function to use as getter.
17
17
  *
18
18
  * utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) {