Comparing version 10.0.1 to 11.0.0
11.0.0 / 2021-05-24 | ||
================== | ||
* Explicitly use samsam 6.0.2 with fix for #2345 | ||
* Update most packages (#2371) | ||
* Update compatibility docs (#2366) | ||
* Update packages (includes breaking fake-timers change, see #2352) | ||
* Warn of potential memory leaks (#2357) | ||
* Fix clock test errors | ||
10.0.1 / 2021-04-08 | ||
@@ -3,0 +13,0 @@ ================== |
@@ -5,4 +5,4 @@ "use strict"; | ||
var getPropertyDescriptor = require("./util/core/get-property-descriptor"); | ||
var hasOwnProperty = require("@sinonjs/commons").prototypes.object | ||
.hasOwnProperty; | ||
var hasOwnProperty = | ||
require("@sinonjs/commons").prototypes.object.hasOwnProperty; | ||
var push = require("@sinonjs/commons").prototypes.array.push; | ||
@@ -9,0 +9,0 @@ |
"use strict"; | ||
var arrayProto = require("@sinonjs/commons").prototypes.array; | ||
var logger = require("@sinonjs/commons").deprecated; | ||
var collectOwnMethods = require("./collect-own-methods"); | ||
@@ -19,2 +20,4 @@ var getPropertyDescriptor = require("./util/core/get-property-descriptor"); | ||
var DEFAULT_LEAK_THRESHOLD = 10000; | ||
var filter = arrayProto.filter; | ||
@@ -37,6 +40,22 @@ var forEach = arrayProto.forEach; | ||
var sandbox = this; | ||
var collection = []; | ||
var fakeRestorers = []; | ||
var promiseLib; | ||
var collection = []; | ||
var loggedLeakWarning = false; | ||
sandbox.leakThreshold = DEFAULT_LEAK_THRESHOLD; | ||
function addToCollection(object) { | ||
if ( | ||
push(collection, object) > sandbox.leakThreshold && | ||
!loggedLeakWarning | ||
) { | ||
// eslint-disable-next-line no-console | ||
logger.printWarning( | ||
"Potential memory leak detected; be sure to call restore() to clean up your sandbox. To suppress this warning, modify the leakThreshold property of your sandbox." | ||
); | ||
loggedLeakWarning = true; | ||
} | ||
} | ||
sandbox.assert = sinonAssert.createAssertObject(); | ||
@@ -62,3 +81,3 @@ | ||
forEach(ownMethods, function (method) { | ||
push(collection, method); | ||
addToCollection(method); | ||
}); | ||
@@ -121,3 +140,3 @@ | ||
push(collection, m); | ||
addToCollection(m); | ||
usePromiseLibrary(promiseLib, m); | ||
@@ -355,3 +374,3 @@ | ||
forEach(ownMethods, function (method) { | ||
push(collection, method); | ||
addToCollection(method); | ||
}); | ||
@@ -361,3 +380,3 @@ | ||
} else { | ||
push(collection, spy); | ||
addToCollection(spy); | ||
usePromiseLibrary(promiseLib, spy); | ||
@@ -383,3 +402,3 @@ } | ||
push(collection, s); | ||
addToCollection(s); | ||
@@ -395,3 +414,3 @@ return s; | ||
push(collection, s); | ||
addToCollection(s); | ||
@@ -407,3 +426,3 @@ return s; | ||
sandbox.clock = clock; | ||
push(collection, clock); | ||
addToCollection(clock); | ||
@@ -441,3 +460,3 @@ return clock; | ||
sandbox.server = proto.create(); | ||
push(collection, sandbox.server); | ||
addToCollection(sandbox.server); | ||
@@ -449,3 +468,3 @@ return sandbox.server; | ||
var xhr = fakeXhr.useFakeXMLHttpRequest(); | ||
push(collection, xhr); | ||
addToCollection(xhr); | ||
return xhr; | ||
@@ -452,0 +471,0 @@ }; |
@@ -8,4 +8,4 @@ "use strict"; | ||
var functionName = require("@sinonjs/commons").functionName; | ||
var hasOwnProperty = require("@sinonjs/commons").prototypes.object | ||
.hasOwnProperty; | ||
var hasOwnProperty = | ||
require("@sinonjs/commons").prototypes.object.hasOwnProperty; | ||
var isNonExistentProperty = require("./util/core/is-non-existent-property"); | ||
@@ -220,3 +220,4 @@ var spy = require("./spy"); | ||
fake.defaultBehavior || behavior.create(fake); | ||
fake.defaultBehavior.promiseLibrary = this.defaultBehavior.promiseLibrary; | ||
fake.defaultBehavior.promiseLibrary = | ||
this.defaultBehavior.promiseLibrary; | ||
} | ||
@@ -223,0 +224,0 @@ return fake; |
"use strict"; | ||
var arrayProto = require("@sinonjs/commons").prototypes.array; | ||
var hasOwnProperty = require("@sinonjs/commons").prototypes.object | ||
.hasOwnProperty; | ||
var hasOwnProperty = | ||
require("@sinonjs/commons").prototypes.object.hasOwnProperty; | ||
@@ -7,0 +7,0 @@ var join = arrayProto.join; |
"use strict"; | ||
var defaultConfig = require("./default-config"); | ||
var hasOwnProperty = require("@sinonjs/commons").prototypes.object | ||
.hasOwnProperty; | ||
var hasOwnProperty = | ||
require("@sinonjs/commons").prototypes.object.hasOwnProperty; | ||
@@ -7,0 +7,0 @@ module.exports = function getConfig(custom) { |
@@ -5,4 +5,4 @@ "use strict"; | ||
var extend = require("./extend"); | ||
var hasOwnProperty = require("@sinonjs/commons").prototypes.object | ||
.hasOwnProperty; | ||
var hasOwnProperty = | ||
require("@sinonjs/commons").prototypes.object.hasOwnProperty; | ||
var valueToString = require("@sinonjs/commons").valueToString; | ||
@@ -9,0 +9,0 @@ |
@@ -18,3 +18,3 @@ { | ||
], | ||
"version": "10.0.1", | ||
"version": "11.0.0", | ||
"homepage": "https://sinonjs.org/", | ||
@@ -54,2 +54,3 @@ "author": "Christian Johansen", | ||
"postbuild": "npm run test-esm-bundle", | ||
"prebuild-docs": "./scripts/update-compatibility.js", | ||
"prepublishOnly": "npm run build", | ||
@@ -75,30 +76,32 @@ "prettier:check": "prettier --check '**/*.{js,css,md}'", | ||
"dependencies": { | ||
"@sinonjs/commons": "^1.8.1", | ||
"@sinonjs/fake-timers": "^7.0.4", | ||
"@sinonjs/samsam": "^6.0.1", | ||
"diff": "^4.0.2", | ||
"nise": "^5.0.1", | ||
"supports-color": "^7.1.0" | ||
"@sinonjs/commons": "^1.8.3", | ||
"@sinonjs/fake-timers": "^7.1.0", | ||
"@sinonjs/samsam": "^6.0.2", | ||
"diff": "^5.0.0", | ||
"nise": "^5.0.4", | ||
"supports-color": "^8.1.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.8.3", | ||
"@sinonjs/eslint-config": "^4.0.0", | ||
"@sinonjs/eslint-plugin-no-prototype-methods": "^0.1.0", | ||
"@sinonjs/referee": "^6.1.0", | ||
"@babel/core": "^7.14.3", | ||
"@sinonjs/eslint-config": "^4.0.2", | ||
"@sinonjs/eslint-plugin-no-prototype-methods": "^0.1.1", | ||
"@sinonjs/referee": "^8.0.2", | ||
"babel-plugin-istanbul": "^6.0.0", | ||
"babelify": "^10.0.0", | ||
"browserify": "^16.5.0", | ||
"browserify": "^16.5.2", | ||
"debug": "^4.3.1", | ||
"dependency-check": "^4.1.0", | ||
"esm": "^3.2.25", | ||
"husky": "^4.2.1", | ||
"lint-staged": "^10.0.7", | ||
"mocha": "^6.2.3", | ||
"mochify": "^6.6.0", | ||
"nyc": "^15.0.0", | ||
"prettier": "^2.2.1", | ||
"husky": "^6.0.0", | ||
"lint-staged": "^11.0.0", | ||
"mocha": "^8.4.0", | ||
"mochify": "^7.1.1", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.3.0", | ||
"proxyquire": "^2.1.3", | ||
"proxyquire-universal": "^2.1.0", | ||
"proxyquire-universal": "^3.0.1", | ||
"proxyquireify": "^3.2.1", | ||
"puppeteer": "^2.1.0", | ||
"rimraf": "^3.0.0" | ||
"puppeteer": "^9.1.1", | ||
"rimraf": "^3.0.2", | ||
"shelljs": "^0.8.4" | ||
}, | ||
@@ -105,0 +108,0 @@ "files": [ |
@@ -27,3 +27,5 @@ <h1 align=center> | ||
<p align=center> | ||
<a href="https://saucelabs.com/u/sinonjs"><img src="https://saucelabs.com/browser-matrix/sinonjs.svg" alt="Sauce Test Status"></a> | ||
<a href="https://app.saucelabs.com/u/sinonjs"> | ||
<img src="https://app.saucelabs.com/browser-matrix/sinonjs.svg" alt="Sauce Test Status"/> | ||
</a> | ||
</p> | ||
@@ -30,0 +32,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138
4818585
22
51
58359
8
4
+ Addeddiff@5.2.0(transitive)
+ Addedpath-to-regexp@6.3.0(transitive)
+ Addedsupports-color@8.1.1(transitive)
- Removeddiff@4.0.2(transitive)
- Removedpath-to-regexp@6.2.2(transitive)
- Removedsupports-color@7.2.0(transitive)
Updated@sinonjs/commons@^1.8.3
Updated@sinonjs/fake-timers@^7.1.0
Updated@sinonjs/samsam@^6.0.2
Updateddiff@^5.0.0
Updatednise@^5.0.4
Updatedsupports-color@^8.1.1