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:
@@ -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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user