mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-24 17:51:51 +02:00
* [libraries] move all the unit tests into test/unit * [settings] remove empty test file * [mongo-utils] remove test setup as there are no tests * [libraries] ensure that all libraries with tests have test/setup.js * [monorepo] remove test step from Cloud build for libraries without tests GitOrigin-RevId: b9a0a8a3330db7d8646c7a272b03fbb8c5e44bc0
34 lines
734 B
JavaScript
34 lines
734 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 },
|
|
sourceTransformers: {
|
|
removeNodePrefix: function (source) {
|
|
return source.replace(/require\(['"]node:/g, "require('")
|
|
},
|
|
},
|
|
})
|