[misc] test/unit: add missing require stubs for metrics and settings

This commit is contained in:
Jakob Ackermann 2020-02-23 15:42:04 +00:00
parent 0cdcac4cd2
commit 7920570dd8
2 changed files with 7 additions and 2 deletions

View file

@ -19,7 +19,10 @@ describe('ImageOptimiser', function() {
ImageOptimiser = SandboxedModule.require(modulePath, {
requires: {
'./SafeExec': SafeExec,
'logger-sharelatex': logger
'logger-sharelatex': logger,
'metrics-sharelatex': {
Timer: sinon.stub().returns({ done: sinon.stub() })
}
}
})
})

View file

@ -7,7 +7,9 @@ describe('LocalFileWriter', function() {
const key = 'wombat/potato'
beforeEach(function() {
KeyBuilder = SandboxedModule.require(modulePath)
KeyBuilder = SandboxedModule.require(modulePath, {
requires: { 'settings-sharelatex': {} }
})
})
describe('cachedKey', function() {