-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into rekmarks/reorder-permission-middleware
- Loading branch information
Showing
333 changed files
with
12,749 additions
and
3,930 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
diff --git a/lib/common.js b/lib/common.js | ||
index 336bc4d376d07306d6adf79b8e73cffd4dfff4f7..271d50d42a5a370440fd93de00072ddfdd2fcf4b 100644 | ||
--- a/lib/common.js | ||
+++ b/lib/common.js | ||
@@ -1,7 +1,17 @@ | ||
'use strict' | ||
|
||
const debug = require('debug')('nock.common') | ||
-const timers = require('timers') | ||
+/** | ||
+ * PATCH NOTES: | ||
+ * | ||
+ * Replace Node.js `timers` module with global timers, because Jest/Sinon fake timers do not work | ||
+ * with the Node.js timers module in the version we are using. | ||
+ * | ||
+ * This is resolved in `@sinon/fake-timers@11`, which is introduced in the upcoming `jest@30` | ||
+ * release. | ||
+ * | ||
+ * TODO: Remove this patch after updating to `jest@30`. | ||
+ */ | ||
const url = require('url') | ||
const util = require('util') | ||
|
||
@@ -598,16 +608,16 @@ const intervals = [] | ||
const immediates = [] | ||
|
||
const wrapTimer = | ||
- (timer, ids) => | ||
+ (timerName, ids) => | ||
(...args) => { | ||
- const id = timer(...args) | ||
+ const id = globalThis[timerName](...args) | ||
ids.push(id) | ||
return id | ||
} | ||
|
||
-const setTimeout = wrapTimer(timers.setTimeout, timeouts) | ||
-const setInterval = wrapTimer(timers.setInterval, intervals) | ||
-const setImmediate = wrapTimer(timers.setImmediate, immediates) | ||
+const setTimeout = wrapTimer('setTimeout', timeouts) | ||
+const setInterval = wrapTimer('setInterval', intervals) | ||
+const setImmediate = wrapTimer('setImmediate', immediates) | ||
|
||
function clearTimer(clear, ids) { | ||
while (ids.length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.