overleaf/services/web/test/unit/src/helpers/MockRequest.js
Timothée Alby e38a86d9f4 Merge pull request #1934 from overleaf/ta-error-type-handler
Implement ErrorType Handler

GitOrigin-RevId: 7cd735bb248c74815182e10fd54d687dd35914b8
2019-07-19 09:51:05 +00:00

30 lines
780 B
JavaScript

// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
/*
* decaffeinate suggestions:
* DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
class MockRequest {
static initClass() {
this.prototype.session = { destroy() {} }
this.prototype.params = {}
this.prototype.query = {}
this.prototype.body = {}
this.prototype._parsedUrl = {}
this.prototype.i18n = {
translate(str) {
return str
}
}
this.prototype.route = { path: '' }
this.prototype.accepts = () => {}
}
param(param) {
return this.params[param]
}
}
MockRequest.initClass()
module.exports = MockRequest