mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 12:51:35 +02:00
Move acceptance test mocks to nonstandard ports and add options for running locally GitOrigin-RevId: bd8f70ac8d80599daccc51cfe7b90a2ad8d8c3d8
25 lines
612 B
JavaScript
25 lines
612 B
JavaScript
// 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'}:23000`
|
|
const request = require('request').defaults({
|
|
baseUrl: BASE_URL,
|
|
followRedirect: false,
|
|
})
|
|
|
|
module.exports = request
|
|
module.exports.BASE_URL = BASE_URL
|
|
|
|
module.exports.promises = {
|
|
request: function (options) {
|
|
return new Promise((resolve, reject) => {
|
|
request(options, (err, response) => {
|
|
if (err) {
|
|
reject(err)
|
|
} else {
|
|
resolve(response)
|
|
}
|
|
})
|
|
})
|
|
},
|
|
}
|