MockRequest.js 780 B

123456789101112131415161718192021222324252627282930
  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. }
  23. param(param) {
  24. return this.params[param]
  25. }
  26. }
  27. MockRequest.initClass()
  28. module.exports = MockRequest