mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #2132 from overleaf/spd-collabratec-tests
Make collabratec tests not depend on previous run state GitOrigin-RevId: 264f946e05b848fa253b6fbdd8e97a4998e4158e
This commit is contained in:
parent
4defd2b6b5
commit
a319073a08
3 changed files with 28 additions and 5 deletions
|
@ -20,6 +20,9 @@ const RollingRateLimiter = require('rolling-rate-limiter')
|
|||
|
||||
module.exports = RateLimiter = {
|
||||
addCount(opts, callback) {
|
||||
if (settings.disableRateLimits) {
|
||||
return callback(null, true)
|
||||
}
|
||||
if (callback == null) {
|
||||
callback = function(err, shouldProcess) {}
|
||||
}
|
||||
|
|
|
@ -411,10 +411,14 @@ class User {
|
|||
}
|
||||
if ((body != null ? body.project_id : undefined) == null) {
|
||||
error = new Error(
|
||||
JSON.stringify([
|
||||
'SOMETHING WENT WRONG CREATING PROJECT',
|
||||
name,
|
||||
options,
|
||||
response.statusCode,
|
||||
response.headers['location'],
|
||||
body
|
||||
])
|
||||
)
|
||||
return callback(error)
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,23 @@
|
|||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Sanity-check the conversion and remove this comment.
|
||||
const BASE_URL = `http://${process.env['HTTP_TEST_HOST'] || 'localhost'}:3000`
|
||||
module.exports = require('request').defaults({
|
||||
const request = require('request').defaults({
|
||||
baseUrl: BASE_URL,
|
||||
followRedirect: false
|
||||
})
|
||||
|
||||
module.exports = request
|
||||
|
||||
module.exports.promises = {
|
||||
request: function(options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request(options, (err, response) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
resolve(response)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue