MockRequest.js 820 B

12345678910111213141516171819202122232425262728293031
  1. // TODO: This file was created by bulk-decaffeinate.
  2. // Sanity-check the conversion and remove this comment.
  3. /*
  4. * decaffeinate suggestions:
  5. * DS206: Consider reworking classes to avoid initClass
  6. * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  7. */
  8. class MockRequest {
  9. static initClass() {
  10. this.prototype.session = { destroy() {} }
  11. this.prototype.params = {}
  12. this.prototype.query = {}
  13. this.prototype.body = {}
  14. this.prototype._parsedUrl = {}
  15. this.prototype.i18n = {
  16. translate(str) {
  17. return str
  18. }
  19. }
  20. this.prototype.route = { path: '' }
  21. this.prototype.accepts = () => {}
  22. this.prototype.setHeader = () => {}
  23. }
  24. param(param) {
  25. return this.params[param]
  26. }
  27. }
  28. MockRequest.initClass()
  29. module.exports = MockRequest