acquirerPlugin2.js 804 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. var _globals = require("@jest/globals");
  3. // eslint-disable-line import/no-extraneous-dependencies
  4. const UIPlugin = require("../UIPlugin.js");
  5. class TestSelector2 extends UIPlugin {
  6. constructor(uppy, opts) {
  7. super(uppy, opts);
  8. this.type = 'acquirer';
  9. this.id = 'TestSelector2';
  10. this.name = this.constructor.name;
  11. this.mocks = {
  12. run: _globals.jest.fn(),
  13. update: _globals.jest.fn(),
  14. uninstall: _globals.jest.fn()
  15. };
  16. }
  17. run(results) {
  18. this.uppy.log({
  19. class: this.constructor.name,
  20. method: 'run',
  21. results
  22. });
  23. this.mocks.run(results);
  24. return Promise.resolve('success');
  25. }
  26. update(state) {
  27. this.mocks.update(state);
  28. }
  29. uninstall() {
  30. this.mocks.uninstall();
  31. }
  32. }
  33. module.exports = TestSelector2;