@trackunit/react-test-setup 1.3.26 → 1.3.28
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/index.cjs.js +13 -5
- package/index.esm.js +13 -5
- package/package.json +3 -3
package/index.cjs.js
CHANGED
|
@@ -268,7 +268,7 @@ const setupResponseForTanstackRouter = () => {
|
|
|
268
268
|
// Polyfill for Response global that TanStack Router v1+ requires
|
|
269
269
|
if (typeof globalThis.Response === "undefined") {
|
|
270
270
|
// Simple polyfill for Response in test environment
|
|
271
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
271
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
272
272
|
globalThis.Response = class Response {
|
|
273
273
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
274
274
|
constructor(body, init) {
|
|
@@ -307,7 +307,7 @@ const setupResponseForTanstackRouter = () => {
|
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
309
|
if (typeof globalThis.Headers === "undefined") {
|
|
310
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
310
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
311
311
|
globalThis.Headers = class Headers {
|
|
312
312
|
constructor(init) {
|
|
313
313
|
this.map = new Map();
|
|
@@ -480,7 +480,7 @@ const setupReactVirtualizedAutoSizer = () => {
|
|
|
480
480
|
* Recommended for all react libs
|
|
481
481
|
*/
|
|
482
482
|
const setupResizeObserver = () => {
|
|
483
|
-
global.ResizeObserver = jest.fn().mockImplementation((
|
|
483
|
+
global.ResizeObserver = jest.fn().mockImplementation((_callback) => ({
|
|
484
484
|
observe: jest.fn(),
|
|
485
485
|
unobserve: jest.fn(),
|
|
486
486
|
disconnect: jest.fn(),
|
|
@@ -580,10 +580,18 @@ const setupTimeAndLanguage = () => {
|
|
|
580
580
|
global.ORG_setTimeout = globalSetTimeout;
|
|
581
581
|
const globalSetInterval = global.setInterval;
|
|
582
582
|
global.ORG_setInterval = globalSetInterval;
|
|
583
|
-
global.setTimeout = function testSetTimeout(callback,
|
|
583
|
+
global.setTimeout = function testSetTimeout(callback,
|
|
584
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
585
|
+
ms,
|
|
586
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
587
|
+
...args) {
|
|
584
588
|
return globalSetTimeout.apply(this, [callback, 0]);
|
|
585
589
|
};
|
|
586
|
-
global.setInterval = function testSetInterval(callback,
|
|
590
|
+
global.setInterval = function testSetInterval(callback,
|
|
591
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
592
|
+
ms,
|
|
593
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
594
|
+
...args) {
|
|
587
595
|
return globalSetInterval.apply(this, [callback, 0]);
|
|
588
596
|
};
|
|
589
597
|
};
|
package/index.esm.js
CHANGED
|
@@ -247,7 +247,7 @@ const setupResponseForTanstackRouter = () => {
|
|
|
247
247
|
// Polyfill for Response global that TanStack Router v1+ requires
|
|
248
248
|
if (typeof globalThis.Response === "undefined") {
|
|
249
249
|
// Simple polyfill for Response in test environment
|
|
250
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
250
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
251
251
|
globalThis.Response = class Response {
|
|
252
252
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
253
253
|
constructor(body, init) {
|
|
@@ -286,7 +286,7 @@ const setupResponseForTanstackRouter = () => {
|
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
288
|
if (typeof globalThis.Headers === "undefined") {
|
|
289
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
289
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
290
290
|
globalThis.Headers = class Headers {
|
|
291
291
|
constructor(init) {
|
|
292
292
|
this.map = new Map();
|
|
@@ -459,7 +459,7 @@ const setupReactVirtualizedAutoSizer = () => {
|
|
|
459
459
|
* Recommended for all react libs
|
|
460
460
|
*/
|
|
461
461
|
const setupResizeObserver = () => {
|
|
462
|
-
global.ResizeObserver = jest.fn().mockImplementation((
|
|
462
|
+
global.ResizeObserver = jest.fn().mockImplementation((_callback) => ({
|
|
463
463
|
observe: jest.fn(),
|
|
464
464
|
unobserve: jest.fn(),
|
|
465
465
|
disconnect: jest.fn(),
|
|
@@ -559,10 +559,18 @@ const setupTimeAndLanguage = () => {
|
|
|
559
559
|
global.ORG_setTimeout = globalSetTimeout;
|
|
560
560
|
const globalSetInterval = global.setInterval;
|
|
561
561
|
global.ORG_setInterval = globalSetInterval;
|
|
562
|
-
global.setTimeout = function testSetTimeout(callback,
|
|
562
|
+
global.setTimeout = function testSetTimeout(callback,
|
|
563
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
564
|
+
ms,
|
|
565
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
566
|
+
...args) {
|
|
563
567
|
return globalSetTimeout.apply(this, [callback, 0]);
|
|
564
568
|
};
|
|
565
|
-
global.setInterval = function testSetInterval(callback,
|
|
569
|
+
global.setInterval = function testSetInterval(callback,
|
|
570
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
571
|
+
ms,
|
|
572
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
573
|
+
...args) {
|
|
566
574
|
return globalSetInterval.apply(this, [callback, 0]);
|
|
567
575
|
};
|
|
568
576
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-test-setup",
|
|
3
3
|
"description": "Test setup utilities for React applications",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.28",
|
|
5
5
|
"repository": "https://github.com/Trackunit/manager",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
7
7
|
"engines": {
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@googlemaps/jest-mocks": "2.21.4",
|
|
24
|
-
"@js-temporal/polyfill": "^0.5.1",
|
|
25
24
|
"@okta/okta-auth-js": "^7.14.0",
|
|
26
25
|
"@react-spring/web": "9.7.5",
|
|
27
26
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -35,7 +34,8 @@
|
|
|
35
34
|
"web-streams-polyfill": "^4.1.0",
|
|
36
35
|
"@okta/okta-react": "^6.10.0",
|
|
37
36
|
"react-router-dom": "6.18.0",
|
|
38
|
-
"jest": "29.7.0"
|
|
37
|
+
"jest": "29.7.0",
|
|
38
|
+
"@js-temporal/polyfill": "^0.5.1"
|
|
39
39
|
},
|
|
40
40
|
"module": "./index.esm.js",
|
|
41
41
|
"main": "./index.cjs.js",
|