@papillonarts/setup 0.44.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import '@testing-library/jest-dom';
1
2
  import 'jsdom-global/register';
2
3
  export declare function runJestSetup(): void;
3
4
  //# sourceMappingURL=setup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/jest/setup.ts"],"names":[],"mappings":"AAGA,OAAO,uBAAuB,CAAA;AAG9B,wBAAgB,YAAY,SAmG3B"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/jest/setup.ts"],"names":[],"mappings":"AACA,OAAO,2BAA2B,CAAA;AAGlC,OAAO,uBAAuB,CAAA;AAG9B,wBAAgB,YAAY,SAoH3B"}
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.runJestSetup = runJestSetup;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ require("@testing-library/jest-dom");
7
11
  var _react = require("@testing-library/react");
8
12
  var _jestAxe = require("jest-axe");
9
13
  require("jsdom-global/register");
@@ -93,13 +97,6 @@ function runJestSetup() {
93
97
  }
94
98
  return originalToLocaleTimeString.call(this, locale, options);
95
99
  };
96
- global.act = _react.act;
97
- global.cleanup = _react.cleanup;
98
- global.fireEvent = _react.fireEvent;
99
- global.render = _react.render;
100
- global.renderToJSON = function (component) {
101
- return (0, _react.render)(component).container;
102
- };
103
100
  global.axe = (0, _jestAxe.configureAxe)({
104
101
  rules: {
105
102
  region: {
@@ -107,6 +104,35 @@ function runJestSetup() {
107
104
  }
108
105
  }
109
106
  });
107
+ global.act = _react.act;
108
+ global.cleanup = _react.cleanup;
109
+ global.fireEvent = _react.fireEvent;
110
+ // Add MutationObserver polyfill for tests
111
+ global.MutationObserver = /*#__PURE__*/function () {
112
+ function _class(callback) {
113
+ (0, _classCallCheck2["default"])(this, _class);
114
+ this.callback = callback;
115
+ }
116
+ return (0, _createClass2["default"])(_class, [{
117
+ key: "disconnect",
118
+ value: function disconnect() {}
119
+ }, {
120
+ key: "observe",
121
+ value: function observe() {
122
+ // Call the callback immediately to simulate initial observation
123
+ this.callback([], this);
124
+ }
125
+ }, {
126
+ key: "takeRecords",
127
+ value: function takeRecords() {
128
+ return [];
129
+ }
130
+ }]);
131
+ }();
132
+ global.render = _react.render;
133
+ global.renderToJSON = function (component) {
134
+ return (0, _react.render)(component).container;
135
+ };
110
136
  expect.extend(_jestAxe.toHaveNoViolations);
111
137
  expect.extend({
112
138
  toMatchDiffSnapshot: _snapshotDiff.toMatchDiffSnapshot
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@papillonarts/setup",
3
- "version": "0.44.0",
3
+ "version": "0.45.0",
4
4
  "description": "Papillon Arts Setup",
5
5
  "homepage": "https://github.com/papillonarts/papillonarts/tree/master/packages/setup",
6
6
  "repository": {
@@ -37,5 +37,5 @@
37
37
  "build-acceptance": "npm run build",
38
38
  "build-release": "npm run build"
39
39
  },
40
- "gitHead": "52ef922fc375efa9f422ba027ee78ec16dc63e82"
40
+ "gitHead": "b632bc28824413203621efd72de2adcc04c094c8"
41
41
  }