Merge pull request #10245 from overleaf/em-object-persistor-promises-api

Use Node 16 promises APIs in object-persistor

GitOrigin-RevId: 8520da0c0678c17b22a9164d15d61c2b57af8f4e
This commit is contained in:
Eric Mc Sween
2022-11-11 09:03:19 +00:00
committed by Copybot
parent ff944917a6
commit 8fb3edbecd
9 changed files with 108 additions and 76 deletions
@@ -23,7 +23,13 @@ describe('MigrationPersistorTests', function () {
const size = 33
const md5 = 'ffffffff'
let Settings, Logger, Stream, MigrationPersistor, fileStream, newPersistor
let Settings,
Logger,
Stream,
StreamPromises,
MigrationPersistor,
fileStream,
newPersistor
beforeEach(function () {
fileStream = {
@@ -64,10 +70,13 @@ describe('MigrationPersistorTests', function () {
}
Stream = {
pipeline: sinon.stub().yields(),
PassThrough: sinon.stub(),
}
StreamPromises = {
pipeline: sinon.stub().resolves(),
}
Logger = {
warn: sinon.stub(),
}
@@ -75,6 +84,7 @@ describe('MigrationPersistorTests', function () {
MigrationPersistor = SandboxedModule.require(modulePath, {
requires: {
stream: Stream,
'stream/promises': StreamPromises,
'./Errors': Errors,
'@overleaf/logger': Logger,
},