index.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _pure = require("./pure");
  6. Object.keys(_pure).forEach(function (key) {
  7. if (key === "default" || key === "__esModule") return;
  8. if (key in exports && exports[key] === _pure[key]) return;
  9. Object.defineProperty(exports, key, {
  10. enumerable: true,
  11. get: function () {
  12. return _pure[key];
  13. }
  14. });
  15. });
  16. var _process$env;
  17. // if we're running in a test runner that supports afterEach
  18. // or teardown then we'll automatically run cleanup afterEach test
  19. // this ensures that tests run in isolation from each other
  20. // if you don't like this then either import the `pure` module
  21. // or set the RTL_SKIP_AUTO_CLEANUP env variable to 'true'.
  22. if (typeof process === "undefined" || !((_process$env = process.env) != null && _process$env.RTL_SKIP_AUTO_CLEANUP)) {
  23. // ignore teardown() in code coverage because Jest does not support it
  24. /* istanbul ignore else */
  25. if (typeof afterEach === 'function') {
  26. afterEach(() => {
  27. (0, _pure.cleanup)();
  28. });
  29. } else if (typeof teardown === 'function') {
  30. // Block is guarded by `typeof` check.
  31. // eslint does not support `typeof` guards.
  32. // eslint-disable-next-line no-undef
  33. teardown(() => {
  34. (0, _pure.cleanup)();
  35. });
  36. }
  37. }