agent.js 570 B

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. const mm = require('mm');
  3. const mockHttpclient = require('../../lib/mock_httpclient');
  4. module.exports = {
  5. /**
  6. * mock httpclient
  7. * @function Agent#mockHttpclient
  8. * @param {...any} args - args
  9. * @return {Context} this
  10. */
  11. mockHttpclient(...args) {
  12. if (!this._mockHttpclient) {
  13. this._mockHttpclient = mockHttpclient(this);
  14. }
  15. return this._mockHttpclient(...args);
  16. },
  17. /**
  18. * @see mm#restore
  19. * @function Agent#mockRestore
  20. */
  21. mockRestore: mm.restore,
  22. /**
  23. * @see mm
  24. * @function Agent#mm
  25. */
  26. mm,
  27. };