You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mocha (I believe) is detecting variables leaked to global scope. I just upgrade from chai v3.5 to v4.1.2 now I am getting the following test failures:
Error: global leak detected: errorMessage
if I grep -rn errorMessage node_modules/chai I see:
node_modules/chai/chai.js
1513: errorMessage = msgPrefix + 'the argument to above must be a date';
1515: errorMessage = msgPrefix + 'the argument to above must be a number';
1518: errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
1524: throw new AssertionError(errorMessage, undefined, ssfi);
1609: errorMessage = msgPrefix + 'the argument to least must be a date';
1611: errorMessage = msgPrefix + 'the argument to least must be a number';
1614: errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
1620: throw new AssertionError(errorMessage, undefined, ssfi);
1704: errorMessage = msgPrefix + 'the argument to below must be a date';
1706: errorMessage = msgPrefix + 'the argument to below must be a number';
1709: errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
1715: throw new AssertionError(errorMessage, undefined, ssfi);
1799: errorMessage = msgPrefix + 'the argument to most must be a date';
1801: errorMessage = msgPrefix + 'the argument to most must be a number';
1804: errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
1810: throw new AssertionError(errorMessage, undefined, ssfi);
1898: errorMessage = msgPrefix + 'the arguments to within must be dates';
1900: errorMessage = msgPrefix + 'the arguments to within must be numbers';
1903: errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
1909: throw new AssertionError(errorMessage, undefined, ssfi);
node_modules/chai/lib/chai/core/assertions.js
1152: errorMessage = msgPrefix + 'the argument to above must be a date';
1154: errorMessage = msgPrefix + 'the argument to above must be a number';
1157: errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
1163: throw new AssertionError(errorMessage, undefined, ssfi);
1248: errorMessage = msgPrefix + 'the argument to least must be a date';
1250: errorMessage = msgPrefix + 'the argument to least must be a number';
1253: errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
1259: throw new AssertionError(errorMessage, undefined, ssfi);
1343: errorMessage = msgPrefix + 'the argument to below must be a date';
1345: errorMessage = msgPrefix + 'the argument to below must be a number';
1348: errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
1354: throw new AssertionError(errorMessage, undefined, ssfi);
1438: errorMessage = msgPrefix + 'the argument to most must be a date';
1440: errorMessage = msgPrefix + 'the argument to most must be a number';
1443: errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
1449: throw new AssertionError(errorMessage, undefined, ssfi);
1537: errorMessage = msgPrefix + 'the arguments to within must be dates';
1539: errorMessage = msgPrefix + 'the arguments to within must be numbers';
1542: errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date';
1548: throw new AssertionError(errorMessage, undefined, ssfi);```
I don't see any var, let or const declaring errorMessage so it appears that indeed it appears to be leaking into the global scope.
The text was updated successfully, but these errors were encountered:
Mocha (I believe) is detecting variables leaked to global scope. I just upgrade from chai v3.5 to v4.1.2 now I am getting the following test failures:
if I
grep -rn errorMessage node_modules/chai
I see:I don't see any
var
,let
orconst
declaringerrorMessage
so it appears that indeed it appears to be leaking into the global scope.The text was updated successfully, but these errors were encountered: