@papillonarts/setup 0.44.0 → 0.46.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.
- package/build/jest/config.js +1 -1
- package/build/jest/setup.d.ts.map +1 -1
- package/build/jest/setup.js +32 -7
- package/package.json +2 -2
package/build/jest/config.js
CHANGED
|
@@ -32,7 +32,7 @@ function getJestSetup(_ref) {
|
|
|
32
32
|
collectCoverageFrom: collectCoverageFrom,
|
|
33
33
|
// https://jest-extended.jestcommunity.dev/docs/getting-started/setup
|
|
34
34
|
// https://jest-extended.jestcommunity.dev/docs/matchers
|
|
35
|
-
setupFilesAfterEnv: ['<rootDir>/jest.setup.js', 'jest-extended/all'],
|
|
35
|
+
setupFilesAfterEnv: ['@testing-library/jest-dom', '<rootDir>/jest.setup.js', 'jest-extended/all'],
|
|
36
36
|
moduleNameMapper: {
|
|
37
37
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|md)$': '<rootDir>/.mock/file.js',
|
|
38
38
|
'^.+\\.(css|less|scss|md)$': 'identity-obj-proxy'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/jest/setup.ts"],"names":[],"mappings":"AAGA,OAAO,uBAAuB,CAAA;AAG9B,wBAAgB,YAAY,
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/jest/setup.ts"],"names":[],"mappings":"AAGA,OAAO,uBAAuB,CAAA;AAG9B,wBAAgB,YAAY,SAoH3B"}
|
package/build/jest/setup.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
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"));
|
|
7
10
|
var _react = require("@testing-library/react");
|
|
8
11
|
var _jestAxe = require("jest-axe");
|
|
9
12
|
require("jsdom-global/register");
|
|
@@ -93,13 +96,6 @@ function runJestSetup() {
|
|
|
93
96
|
}
|
|
94
97
|
return originalToLocaleTimeString.call(this, locale, options);
|
|
95
98
|
};
|
|
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
99
|
global.axe = (0, _jestAxe.configureAxe)({
|
|
104
100
|
rules: {
|
|
105
101
|
region: {
|
|
@@ -107,6 +103,35 @@ function runJestSetup() {
|
|
|
107
103
|
}
|
|
108
104
|
}
|
|
109
105
|
});
|
|
106
|
+
global.act = _react.act;
|
|
107
|
+
global.cleanup = _react.cleanup;
|
|
108
|
+
global.fireEvent = _react.fireEvent;
|
|
109
|
+
// Add MutationObserver polyfill for tests
|
|
110
|
+
global.MutationObserver = /*#__PURE__*/function () {
|
|
111
|
+
function _class(callback) {
|
|
112
|
+
(0, _classCallCheck2["default"])(this, _class);
|
|
113
|
+
this.callback = callback;
|
|
114
|
+
}
|
|
115
|
+
return (0, _createClass2["default"])(_class, [{
|
|
116
|
+
key: "disconnect",
|
|
117
|
+
value: function disconnect() {}
|
|
118
|
+
}, {
|
|
119
|
+
key: "observe",
|
|
120
|
+
value: function observe() {
|
|
121
|
+
// Call the callback immediately to simulate initial observation
|
|
122
|
+
this.callback([], this);
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
key: "takeRecords",
|
|
126
|
+
value: function takeRecords() {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
}]);
|
|
130
|
+
}();
|
|
131
|
+
global.render = _react.render;
|
|
132
|
+
global.renderToJSON = function (component) {
|
|
133
|
+
return (0, _react.render)(component).container;
|
|
134
|
+
};
|
|
110
135
|
expect.extend(_jestAxe.toHaveNoViolations);
|
|
111
136
|
expect.extend({
|
|
112
137
|
toMatchDiffSnapshot: _snapshotDiff.toMatchDiffSnapshot
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papillonarts/setup",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.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": "
|
|
40
|
+
"gitHead": "16858fa89049ad39bf3c443d1dc4220457adad31"
|
|
41
41
|
}
|