mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 22:11:09 +03:00
Removed sleep
lib from test utils
- this is generally an anti-pattern in tests and leads to flaky behaviour when tests are ran on different machines/loads - this is currently unused so it is an easy removal
This commit is contained in:
parent
6f9f83bee8
commit
08f84475e7
@ -8,7 +8,6 @@ const urlUtils = require('../../../core/shared/url-utils');
|
||||
const imageTransform = require('@tryghost/image-transform');
|
||||
const sinon = require('sinon');
|
||||
const storage = require('../../../core/server/adapters/storage');
|
||||
const sleep = require('../../utils/sleep');
|
||||
const {anyErrorId} = matchers;
|
||||
const {imageSize} = require('../../../core/server/lib/image');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
|
@ -480,6 +480,5 @@ module.exports = {
|
||||
configUtils: require('./configUtils'),
|
||||
dbUtils: require('./db-utils'),
|
||||
urlUtils: require('./urlUtils'),
|
||||
sleep: require('./sleep'),
|
||||
resetRateLimits
|
||||
};
|
||||
|
@ -1,15 +0,0 @@
|
||||
/**
|
||||
* Adds artificial "sleep" time that can be awaited
|
||||
* In most cases where this module is used we are awaiting
|
||||
* for the async event processing to trigger/finish
|
||||
*
|
||||
* Can probably be substituted by timerPromises in the future
|
||||
* ref.: https://nodejs.org/dist/latest-v18.x/docs/api/timers.html#timerspromisessettimeoutdelay-value-options
|
||||
* @param {number} ms
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
module.exports = ms => (
|
||||
new Promise((resolve) => {
|
||||
setTimeout(resolve, ms);
|
||||
})
|
||||
);
|
Loading…
Reference in New Issue
Block a user