overleaf/libraries/object-persistor/test/Init.js
Jakob Ackermann 8fa676082e Merge pull request #20299 from overleaf/jpa-object-persistor-metrics-dep
[object-persistor] depend on @overleaf/metrics directly

GitOrigin-RevId: eb0c07af8101d44def14154abb552bc77254e074
2024-09-24 08:05:50 +00:00

28 lines
592 B
JavaScript

const SandboxedModule = require('sandboxed-module')
const chai = require('chai')
const sinon = require('sinon')
chai.use(require('sinon-chai'))
chai.use(require('chai-as-promised'))
SandboxedModule.configure({
requires: {
'@overleaf/logger': {
debug() {},
log() {},
info() {},
warn() {},
error() {},
err() {},
},
'@overleaf/metrics': {
inc: sinon.stub(),
count: sinon.stub(),
histogram: sinon.stub(),
Timer: class Timer {
done() {}
},
},
},
globals: { Buffer, Math, console, process, URL },
})