@storve/react 1.0.2 → 1.0.4
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/README.md +0 -16
- package/package.json +9 -3
- package/benchmarks/week3.ts +0 -102
- package/coverage/coverage-summary.json +0 -5
- package/dist/index.cjs.js +0 -9
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js +0 -7
- package/dist/index.esm.js.map +0 -1
- package/rollup.config.mjs +0 -25
- package/src/index.ts +0 -4
- package/src/types.ts +0 -16
- package/src/useDevtools.ts +0 -74
- package/src/useStore.ts +0 -83
- package/test_output.txt +0 -234
- package/tests/computed.react.test.tsx +0 -71
- package/tests/concurrent.test.tsx +0 -101
- package/tests/index.test.tsx +0 -29
- package/tests/integration.test.tsx +0 -135
- package/tests/lifecycle.test.tsx +0 -148
- package/tests/selector.test.tsx +0 -288
- package/tests/setup.ts +0 -7
- package/tests/useDevtools.test.tsx +0 -80
- package/tests/useStore.test.tsx +0 -233
- package/tsconfig.json +0 -16
- package/vitest.config.mts +0 -30
package/README.md
CHANGED
|
@@ -1014,22 +1014,6 @@ counterStore.increment()
|
|
|
1014
1014
|
|
|
1015
1015
|
---
|
|
1016
1016
|
|
|
1017
|
-
## Roadmap
|
|
1018
|
-
|
|
1019
|
-
| Version | Theme | Status |
|
|
1020
|
-
|---|---|---|
|
|
1021
|
-
| v0.1–v0.3 | Core store, React adapter, Immer, Actions | ✅ Shipped |
|
|
1022
|
-
| v0.4 | Async state — createAsync, TTL, SWR, optimistic | ✅ Shipped |
|
|
1023
|
-
| v0.5 | Computed values + Signals | ✅ Shipped |
|
|
1024
|
-
| v0.6 | DevTools — Time-travel, Undo/Redo, Snapshots | ✅ Shipped |
|
|
1025
|
-
| v0.7 | Cross-tab sync via BroadcastChannel | ✅ Shipped |
|
|
1026
|
-
| v1.0 | Stable API, polished README, StackBlitz demo | ✅ Shipped |
|
|
1027
|
-
| v1.1 | Purpose-built DevTools browser extension | 📋 Planned |
|
|
1028
|
-
| v1.2 | Full docs site (Docusaurus) | 📋 Planned |
|
|
1029
|
-
| v1.3 | Middleware system | 📋 Planned |
|
|
1030
|
-
|
|
1031
|
-
---
|
|
1032
|
-
|
|
1033
1017
|
## License
|
|
1034
1018
|
|
|
1035
1019
|
MIT © 2026 Storve
|
package/package.json
CHANGED
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/Nam1001/React-Flux.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.4",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
8
13
|
"main": "dist/index.cjs",
|
|
9
14
|
"module": "dist/index.mjs",
|
|
10
15
|
"types": "dist/index.d.ts",
|
|
@@ -17,6 +22,7 @@
|
|
|
17
22
|
},
|
|
18
23
|
"scripts": {
|
|
19
24
|
"build": "rollup -c",
|
|
25
|
+
"prepack": "rm -f dist/index.cjs.js dist/index.cjs.js.map dist/index.esm.js dist/index.esm.js.map",
|
|
20
26
|
"test": "vitest run --coverage && npx tsx benchmarks/week3.ts",
|
|
21
27
|
"test:watch": "vitest --coverage",
|
|
22
28
|
"test:coverage": "vitest run --coverage",
|
|
@@ -24,7 +30,7 @@
|
|
|
24
30
|
"lint": "eslint src --ext .ts,.tsx"
|
|
25
31
|
},
|
|
26
32
|
"dependencies": {
|
|
27
|
-
"@storve/core": "1.0.
|
|
33
|
+
"@storve/core": "1.0.3"
|
|
28
34
|
},
|
|
29
35
|
"peerDependencies": {
|
|
30
36
|
"react": ">=18.0.0"
|
|
@@ -41,4 +47,4 @@
|
|
|
41
47
|
"tsx": "^4.21.0",
|
|
42
48
|
"vitest": "^2.1.0"
|
|
43
49
|
}
|
|
44
|
-
}
|
|
50
|
+
}
|
package/benchmarks/week3.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { performance } from 'perf_hooks'
|
|
2
|
-
import { createStore } from '@storve/core'
|
|
3
|
-
|
|
4
|
-
type BenchmarkResult = {
|
|
5
|
-
operation: string
|
|
6
|
-
averageMs: string
|
|
7
|
-
status: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function bench(label: string, fn: () => void, iterations = 100_000): BenchmarkResult {
|
|
11
|
-
for (let i = 0; i < 1000; i++) fn()
|
|
12
|
-
|
|
13
|
-
const start = performance.now()
|
|
14
|
-
for (let i = 0; i < iterations; i++) fn()
|
|
15
|
-
const avg = (performance.now() - start) / iterations
|
|
16
|
-
|
|
17
|
-
const limits: Record<string, number> = {
|
|
18
|
-
'useStore() subscription setup': 0.5,
|
|
19
|
-
'useStore() subscription cleanup': 0.5,
|
|
20
|
-
'selector execution (primitive)': 0.1,
|
|
21
|
-
'selector execution (derived)': 0.1,
|
|
22
|
-
'setState() write + notify (10 subs)': 1,
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const limit = limits[label] ?? 1
|
|
26
|
-
const status = avg <= limit ? '✅ PASS' : '❌ FAIL'
|
|
27
|
-
return { operation: label, averageMs: avg.toFixed(8) + 'ms', status }
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function runBenchmarks(): void {
|
|
31
|
-
console.log('\n⚡ Storve React Adapter — Benchmark Results\n')
|
|
32
|
-
|
|
33
|
-
const results: BenchmarkResult[] = []
|
|
34
|
-
|
|
35
|
-
// 1. Subscription setup
|
|
36
|
-
const store1 = createStore({ count: 0 })
|
|
37
|
-
results.push(bench('useStore() subscription setup', () => {
|
|
38
|
-
const unsub = store1.subscribe(() => {})
|
|
39
|
-
unsub()
|
|
40
|
-
}))
|
|
41
|
-
|
|
42
|
-
// 2. Subscription cleanup
|
|
43
|
-
const store2 = createStore({ count: 0 })
|
|
44
|
-
const unsubs: Array<() => void> = []
|
|
45
|
-
results.push(bench('useStore() subscription cleanup', () => {
|
|
46
|
-
const unsub = store2.subscribe(() => {})
|
|
47
|
-
unsubs.push(unsub)
|
|
48
|
-
unsubs.pop()?.()
|
|
49
|
-
}))
|
|
50
|
-
|
|
51
|
-
// 3. Selector execution primitive
|
|
52
|
-
const store3 = createStore({ count: 42, name: 'test' })
|
|
53
|
-
results.push(bench('selector execution (primitive)', () => {
|
|
54
|
-
const state = store3.getState()
|
|
55
|
-
void state.count
|
|
56
|
-
}))
|
|
57
|
-
|
|
58
|
-
// 4. Selector execution derived
|
|
59
|
-
const store4 = createStore({ a: 10, b: 20 })
|
|
60
|
-
results.push(bench('selector execution (derived)', () => {
|
|
61
|
-
const state = store4.getState()
|
|
62
|
-
void (state.a + state.b)
|
|
63
|
-
}))
|
|
64
|
-
|
|
65
|
-
// 5. setState + notify
|
|
66
|
-
const store5 = createStore({ count: 0 })
|
|
67
|
-
for (let i = 0; i < 10; i++) store5.subscribe(() => {})
|
|
68
|
-
let c = 0
|
|
69
|
-
results.push(bench('setState() write + notify (10 subs)', () => {
|
|
70
|
-
store5.setState({ count: c++ })
|
|
71
|
-
}, 10_000))
|
|
72
|
-
|
|
73
|
-
const colWidths = { operation: 45, averageMs: 20, status: 10 }
|
|
74
|
-
const header =
|
|
75
|
-
'Operation'.padEnd(colWidths.operation) +
|
|
76
|
-
'Average Time'.padEnd(colWidths.averageMs) +
|
|
77
|
-
'Status'
|
|
78
|
-
const divider = '-'.repeat(header.length)
|
|
79
|
-
|
|
80
|
-
console.log(header)
|
|
81
|
-
console.log(divider)
|
|
82
|
-
|
|
83
|
-
let allPassed = true
|
|
84
|
-
for (const r of results) {
|
|
85
|
-
if (r.status.includes('FAIL')) allPassed = false
|
|
86
|
-
console.log(
|
|
87
|
-
r.operation.padEnd(colWidths.operation) +
|
|
88
|
-
r.averageMs.padEnd(colWidths.averageMs) +
|
|
89
|
-
r.status
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
console.log(divider)
|
|
94
|
-
console.log(allPassed
|
|
95
|
-
? '\n✅ All benchmarks passed!\n'
|
|
96
|
-
: '\n❌ Some benchmarks failed!\n'
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
if (!allPassed) process.exit(1)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
runBenchmarks()
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
{"total": {"lines":{"total":89,"covered":89,"skipped":0,"pct":100},"statements":{"total":89,"covered":89,"skipped":0,"pct":100},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"branches":{"total":42,"covered":37,"skipped":0,"pct":88.09},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
|
|
2
|
-
,"/Users/dipanshusrivastava/Desktop/React Flux/packages/storve-react/src/index.ts": {"lines":{"total":1,"covered":1,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":1,"covered":1,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
|
|
3
|
-
,"/Users/dipanshusrivastava/Desktop/React Flux/packages/storve-react/src/useDevtools.ts": {"lines":{"total":21,"covered":21,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":21,"covered":21,"skipped":0,"pct":100},"branches":{"total":8,"covered":3,"skipped":0,"pct":37.5}}
|
|
4
|
-
,"/Users/dipanshusrivastava/Desktop/React Flux/packages/storve-react/src/useStore.ts": {"lines":{"total":67,"covered":67,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":67,"covered":67,"skipped":0,"pct":100},"branches":{"total":34,"covered":34,"skipped":0,"pct":100}}
|
|
5
|
-
}
|
package/dist/index.cjs.js
DELETED
package/dist/index.cjs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/useStore.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;SAEgB,QAAQ,GAAA;AACpB,IAAA,OAAO,EAAE;AACb;;;;"}
|
package/dist/index.esm.js
DELETED
package/dist/index.esm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/useStore.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;SAEgB,QAAQ,GAAA;AACpB,IAAA,OAAO,EAAE;AACb;;;;"}
|
package/rollup.config.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import typescript from '@rollup/plugin-typescript';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
input: 'src/index.ts',
|
|
5
|
-
external: ['react', '@storve/core'],
|
|
6
|
-
output: [
|
|
7
|
-
{
|
|
8
|
-
file: 'dist/index.cjs',
|
|
9
|
-
format: 'cjs',
|
|
10
|
-
sourcemap: true,
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
file: 'dist/index.mjs',
|
|
14
|
-
format: 'es',
|
|
15
|
-
sourcemap: true,
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
plugins: [
|
|
19
|
-
typescript({
|
|
20
|
-
tsconfig: './tsconfig.json',
|
|
21
|
-
declaration: true,
|
|
22
|
-
declarationDir: 'dist',
|
|
23
|
-
}),
|
|
24
|
-
],
|
|
25
|
-
};
|
package/src/index.ts
DELETED
package/src/types.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Store, StoreState, StoreActions } from '@storve/core'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Selector function — derives a value from store state
|
|
5
|
-
*/
|
|
6
|
-
export type Selector<D extends object, S> = (state: StoreState<D>) => S
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Overloaded useStore hook type
|
|
10
|
-
*/
|
|
11
|
-
export type UseStoreResult<D extends object, S = StoreState<D>> = S & StoreActions<D>
|
|
12
|
-
|
|
13
|
-
export type UseStore = {
|
|
14
|
-
<D extends object>(store: Store<D>): UseStoreResult<D>
|
|
15
|
-
<D extends object, S>(store: Store<D>, selector: Selector<D, S>): UseStoreResult<D, S>
|
|
16
|
-
}
|
package/src/useDevtools.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { useSyncExternalStore, useCallback } from 'react';
|
|
2
|
-
import type { Store } from '@storve/core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A single entry in the devtools history buffer.
|
|
6
|
-
* Mirrors the HistoryEntry type from storve/devtools without requiring a subpath import.
|
|
7
|
-
*/
|
|
8
|
-
export interface HistoryEntry<S> {
|
|
9
|
-
state: S;
|
|
10
|
-
timestamp: number;
|
|
11
|
-
actionName: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal shape of the __devtools property attached by withDevtools.
|
|
16
|
-
* Defined locally to avoid importing internal storve implementation details.
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
interface DevtoolsShape<S> {
|
|
20
|
-
buffer: { entries: HistoryEntry<S>[]; cursor: number; capacity: number };
|
|
21
|
-
snapshots: Map<string, unknown>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Augmented store type with devtools properties.
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
type StoreWithDevtools<S extends object> = Store<S> & {
|
|
29
|
-
__devtools?: DevtoolsShape<S>;
|
|
30
|
-
canUndo?: boolean;
|
|
31
|
-
canRedo?: boolean;
|
|
32
|
-
history?: readonly HistoryEntry<S>[];
|
|
33
|
-
snapshots?: readonly string[];
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* A React hook that subscribes to a devtools-enabled store and returns reactive devtools state.
|
|
39
|
-
*
|
|
40
|
-
* @param store - The Storve store instance (must be wrapped with withDevtools)
|
|
41
|
-
* @returns An object containing canUndo, canRedo, history, and snapshots.
|
|
42
|
-
*/
|
|
43
|
-
export function useDevtools<S extends object>(store: Store<S>): {
|
|
44
|
-
canUndo: boolean;
|
|
45
|
-
canRedo: boolean;
|
|
46
|
-
history: readonly HistoryEntry<S>[];
|
|
47
|
-
snapshots: readonly string[];
|
|
48
|
-
} {
|
|
49
|
-
const devStore = store as StoreWithDevtools<S>;
|
|
50
|
-
|
|
51
|
-
const subscribe = useCallback(
|
|
52
|
-
(callback: () => void) => store.subscribe(callback),
|
|
53
|
-
[store]
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
const getSnapshot = useCallback(() => {
|
|
57
|
-
const internals = devStore.__devtools;
|
|
58
|
-
if (!internals) return '';
|
|
59
|
-
// Combine stable markers to identify changes that require re-render
|
|
60
|
-
return `${internals.buffer.cursor}-${internals.snapshots.size}`;
|
|
61
|
-
}, [devStore]);
|
|
62
|
-
|
|
63
|
-
useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
64
|
-
|
|
65
|
-
// Return the actual properties from the store
|
|
66
|
-
// These are augmented by withDevtools extension
|
|
67
|
-
return {
|
|
68
|
-
canUndo: devStore.canUndo ?? false,
|
|
69
|
-
canRedo: devStore.canRedo ?? false,
|
|
70
|
-
history: devStore.history ?? [],
|
|
71
|
-
snapshots: devStore.snapshots ?? [],
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
package/src/useStore.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { useSyncExternalStore, useRef, useCallback } from 'react'
|
|
2
|
-
import type { Store, StoreState } from '@storve/core'
|
|
3
|
-
import type { Selector, UseStoreResult } from './types'
|
|
4
|
-
|
|
5
|
-
export function shallowEqual(a: unknown, b: unknown): boolean {
|
|
6
|
-
if (Object.is(a, b)) return true
|
|
7
|
-
if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) return false
|
|
8
|
-
const keysA = Object.keys(a)
|
|
9
|
-
const keysB = Object.keys(b)
|
|
10
|
-
if (keysA.length !== keysB.length) return false
|
|
11
|
-
for (const k of keysA) {
|
|
12
|
-
if (
|
|
13
|
-
!Object.prototype.hasOwnProperty.call(b, k) ||
|
|
14
|
-
!Object.is(
|
|
15
|
-
(a as Record<string, unknown>)[k],
|
|
16
|
-
(b as Record<string, unknown>)[k]
|
|
17
|
-
)
|
|
18
|
-
) return false
|
|
19
|
-
}
|
|
20
|
-
return true
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function useStore<D extends object, S = StoreState<D>>(
|
|
24
|
-
store: Store<D>,
|
|
25
|
-
selector?: Selector<D, S>
|
|
26
|
-
): UseStoreResult<D, S> {
|
|
27
|
-
const lastResult = useRef<S | undefined>(undefined)
|
|
28
|
-
const hasUpdate = useRef(false)
|
|
29
|
-
const lastStore = useRef<Store<D> | null>(null)
|
|
30
|
-
|
|
31
|
-
const subscribe = useCallback(
|
|
32
|
-
(callback: () => void) => {
|
|
33
|
-
return store.subscribe(() => {
|
|
34
|
-
hasUpdate.current = true
|
|
35
|
-
callback()
|
|
36
|
-
})
|
|
37
|
-
},
|
|
38
|
-
[store]
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
const getSnapshot = useCallback((): S => {
|
|
42
|
-
const state = store.getState()
|
|
43
|
-
|
|
44
|
-
// Invalidate cache when store reference changes
|
|
45
|
-
if (store !== lastStore.current) {
|
|
46
|
-
lastStore.current = store
|
|
47
|
-
lastResult.current = undefined
|
|
48
|
-
hasUpdate.current = true
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (selector) {
|
|
52
|
-
const next = selector(state)
|
|
53
|
-
if (Object.is(next, lastResult.current)) return lastResult.current as S
|
|
54
|
-
if (
|
|
55
|
-
typeof next === 'object' &&
|
|
56
|
-
next !== null &&
|
|
57
|
-
lastResult.current !== undefined &&
|
|
58
|
-
shallowEqual(next, lastResult.current)
|
|
59
|
-
) {
|
|
60
|
-
return lastResult.current as S
|
|
61
|
-
}
|
|
62
|
-
lastResult.current = next
|
|
63
|
-
return next
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// No selector: return shallow copy when store updated
|
|
67
|
-
if (hasUpdate.current || lastResult.current === undefined) {
|
|
68
|
-
hasUpdate.current = false
|
|
69
|
-
lastResult.current = { ...state } as S // ✅ just cache state, don't merge actions here
|
|
70
|
-
}
|
|
71
|
-
return lastResult.current as S
|
|
72
|
-
}, [store, selector])
|
|
73
|
-
|
|
74
|
-
const result = useSyncExternalStore(subscribe, getSnapshot, getSnapshot)
|
|
75
|
-
|
|
76
|
-
// Handle selector and no-selector cases separately
|
|
77
|
-
if (selector) {
|
|
78
|
-
return result as UseStoreResult<D, S>
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// No selector — merge actions at return time only, not inside getSnapshot
|
|
82
|
-
return Object.assign({}, result as object, store.actions) as UseStoreResult<D, S>
|
|
83
|
-
}
|
package/test_output.txt
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> reactflux-react@0.0.1 test /Users/dipanshusrivastava/Desktop/React Flux/packages/reactflux-react
|
|
3
|
-
> vitest run --coverage && npx tsx benchmarks/week3.ts --filter reactflux-react --run
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
RUN v2.1.0 /Users/dipanshusrivastava/Desktop/React Flux/packages/reactflux-react
|
|
7
|
-
Coverage enabled with v8
|
|
8
|
-
|
|
9
|
-
stderr | tests/selector.test.tsx > useStore with selector > selector returning object re-renders correctly
|
|
10
|
-
Warning: The result of getSnapshot should be cached to avoid an infinite loop
|
|
11
|
-
at Test (/Users/dipanshusrivastava/Desktop/React Flux/packages/reactflux-react/tests/selector.test.tsx:85:41)
|
|
12
|
-
Error: Uncaught [Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.]
|
|
13
|
-
at reportException (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
|
|
14
|
-
at innerInvokeEventListeners (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:353:9)
|
|
15
|
-
at invokeEventListeners (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
|
|
16
|
-
at HTMLUnknownElementImpl._dispatch (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
|
|
17
|
-
at HTMLUnknownElementImpl.dispatchEvent (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17)
|
|
18
|
-
at HTMLUnknownElement.dispatchEvent (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
|
|
19
|
-
at Object.invokeGuardedCallbackDev (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:4213:16)
|
|
20
|
-
at invokeGuardedCallback (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:4277:31)
|
|
21
|
-
at reportUncaughtErrorInDEV (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:22877:5)
|
|
22
|
-
at captureCommitPhaseError (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27165:5) Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
|
|
23
|
-
at checkForNestedUpdates (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27331:11)
|
|
24
|
-
at scheduleUpdateOnFiber (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25514:3)
|
|
25
|
-
at forceStoreRerender (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:16158:5)
|
|
26
|
-
at updateStoreInstance (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:16124:5)
|
|
27
|
-
at commitHookEffectListMount (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:23189:26)
|
|
28
|
-
at commitPassiveMountOnFiber (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24970:11)
|
|
29
|
-
at commitPassiveMountEffects_complete (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24930:9)
|
|
30
|
-
at commitPassiveMountEffects_begin (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24917:7)
|
|
31
|
-
at commitPassiveMountEffects (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24905:3)
|
|
32
|
-
at flushPassiveEffectsImpl (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27078:3)
|
|
33
|
-
The above error occurred in the <Test> component:
|
|
34
|
-
|
|
35
|
-
at Test (/Users/dipanshusrivastava/Desktop/React Flux/packages/reactflux-react/tests/selector.test.tsx:85:41)
|
|
36
|
-
|
|
37
|
-
Consider adding an error boundary to your tree to customize error handling behavior.
|
|
38
|
-
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.
|
|
39
|
-
|
|
40
|
-
stderr | tests/selector.test.tsx > useStore with selector > selector returning array re-renders correctly
|
|
41
|
-
Error: Uncaught [Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.]
|
|
42
|
-
at reportException (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
|
|
43
|
-
at innerInvokeEventListeners (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:353:9)
|
|
44
|
-
at invokeEventListeners (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
|
|
45
|
-
at HTMLUnknownElementImpl._dispatch (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
|
|
46
|
-
at HTMLUnknownElementImpl.dispatchEvent (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17)
|
|
47
|
-
at HTMLUnknownElement.dispatchEvent (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
|
|
48
|
-
at Object.invokeGuardedCallbackDev (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:4213:16)
|
|
49
|
-
at invokeGuardedCallback (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:4277:31)
|
|
50
|
-
at reportUncaughtErrorInDEV (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:22877:5)
|
|
51
|
-
at captureCommitPhaseError (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27165:5) Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
|
|
52
|
-
at checkForNestedUpdates (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27331:11)
|
|
53
|
-
at scheduleUpdateOnFiber (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25514:3)
|
|
54
|
-
at forceStoreRerender (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:16158:5)
|
|
55
|
-
at updateStoreInstance (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:16124:5)
|
|
56
|
-
at commitHookEffectListMount (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:23189:26)
|
|
57
|
-
at commitPassiveMountOnFiber (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24970:11)
|
|
58
|
-
at commitPassiveMountEffects_complete (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24930:9)
|
|
59
|
-
at commitPassiveMountEffects_begin (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24917:7)
|
|
60
|
-
at commitPassiveMountEffects (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24905:3)
|
|
61
|
-
at flushPassiveEffectsImpl (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27078:3)
|
|
62
|
-
The above error occurred in the <Test> component:
|
|
63
|
-
|
|
64
|
-
at Test (/Users/dipanshusrivastava/Desktop/React Flux/packages/reactflux-react/tests/selector.test.tsx:103:43)
|
|
65
|
-
|
|
66
|
-
Consider adding an error boundary to your tree to customize error handling behavior.
|
|
67
|
-
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.
|
|
68
|
-
|
|
69
|
-
❯ tests/selector.test.tsx (15 tests | 2 failed) 50ms
|
|
70
|
-
× useStore with selector > selector returning object re-renders correctly
|
|
71
|
-
→ Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
|
|
72
|
-
× useStore with selector > selector returning array re-renders correctly
|
|
73
|
-
→ Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
|
|
74
|
-
❯ tests/useStore.test.tsx (15 tests | 5 failed) 16ms
|
|
75
|
-
× useStore > returns updated state after setState called
|
|
76
|
-
→ expect(element).toHaveTextContent()
|
|
77
|
-
|
|
78
|
-
Expected element to have text content:
|
|
79
|
-
1
|
|
80
|
-
Received:
|
|
81
|
-
0
|
|
82
|
-
× useStore > component re-renders when state changes
|
|
83
|
-
→ expected "spy" to be called 2 times, but got 1 times
|
|
84
|
-
× useStore > component does NOT re-render when unrelated state changes
|
|
85
|
-
→ expected "spy" to be called 2 times, but got 1 times
|
|
86
|
-
× useStore > multiple components using same store all update correctly
|
|
87
|
-
→ expect(element).toHaveTextContent()
|
|
88
|
-
|
|
89
|
-
Expected element to have text content:
|
|
90
|
-
5
|
|
91
|
-
Received:
|
|
92
|
-
0
|
|
93
|
-
× useStore > multiple components using different stores are independent
|
|
94
|
-
→ expect(element).toHaveTextContent()
|
|
95
|
-
|
|
96
|
-
Expected element to have text content:
|
|
97
|
-
10
|
|
98
|
-
Received:
|
|
99
|
-
1
|
|
100
|
-
✓ tests/lifecycle.test.tsx (9 tests) 30ms
|
|
101
|
-
stderr | tests/integration.test.tsx > integration scenarios > todo list — filter selector shows correct items
|
|
102
|
-
Error: Uncaught [Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.]
|
|
103
|
-
at reportException (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
|
|
104
|
-
at innerInvokeEventListeners (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:353:9)
|
|
105
|
-
at invokeEventListeners (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
|
|
106
|
-
at HTMLUnknownElementImpl._dispatch (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
|
|
107
|
-
at HTMLUnknownElementImpl.dispatchEvent (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17)
|
|
108
|
-
at HTMLUnknownElement.dispatchEvent (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/jsdom@24.1.3/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
|
|
109
|
-
at Object.invokeGuardedCallbackDev (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:4213:16)
|
|
110
|
-
at invokeGuardedCallback (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:4277:31)
|
|
111
|
-
at reportUncaughtErrorInDEV (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:22877:5)
|
|
112
|
-
at captureCommitPhaseError (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27165:5) Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
|
|
113
|
-
at checkForNestedUpdates (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27331:11)
|
|
114
|
-
at scheduleUpdateOnFiber (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25514:3)
|
|
115
|
-
at forceStoreRerender (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:16158:5)
|
|
116
|
-
at updateStoreInstance (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:16124:5)
|
|
117
|
-
at commitHookEffectListMount (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:23189:26)
|
|
118
|
-
at commitPassiveMountOnFiber (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24970:11)
|
|
119
|
-
at commitPassiveMountEffects_complete (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24930:9)
|
|
120
|
-
at commitPassiveMountEffects_begin (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24917:7)
|
|
121
|
-
at commitPassiveMountEffects (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24905:3)
|
|
122
|
-
at flushPassiveEffectsImpl (/Users/dipanshusrivastava/Desktop/React Flux/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27078:3)
|
|
123
|
-
The above error occurred in the <VisibleTodos> component:
|
|
124
|
-
|
|
125
|
-
at VisibleTodos (/Users/dipanshusrivastava/Desktop/React Flux/packages/reactflux-react/tests/integration.test.tsx:49:46)
|
|
126
|
-
|
|
127
|
-
Consider adding an error boundary to your tree to customize error handling behavior.
|
|
128
|
-
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.
|
|
129
|
-
|
|
130
|
-
❯ tests/integration.test.tsx (5 tests | 1 failed) 52ms
|
|
131
|
-
× integration scenarios > todo list — filter selector shows correct items
|
|
132
|
-
→ Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
|
|
133
|
-
✓ tests/concurrent.test.tsx (5 tests) 5ms
|
|
134
|
-
|
|
135
|
-
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 8 ⎯⎯⎯⎯⎯⎯⎯
|
|
136
|
-
|
|
137
|
-
FAIL tests/integration.test.tsx > integration scenarios > todo list — filter selector shows correct items
|
|
138
|
-
FAIL tests/selector.test.tsx > useStore with selector > selector returning object re-renders correctly
|
|
139
|
-
FAIL tests/selector.test.tsx > useStore with selector > selector returning array re-renders correctly
|
|
140
|
-
Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
|
|
141
|
-
❯ checkForNestedUpdates ../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27331:11
|
|
142
|
-
❯ scheduleUpdateOnFiber ../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25514:3
|
|
143
|
-
❯ forceStoreRerender ../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:16158:5
|
|
144
|
-
❯ updateStoreInstance ../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:16124:5
|
|
145
|
-
❯ commitHookEffectListMount ../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:23189:26
|
|
146
|
-
❯ commitPassiveMountOnFiber ../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24970:11
|
|
147
|
-
❯ commitPassiveMountEffects_complete ../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24930:9
|
|
148
|
-
❯ commitPassiveMountEffects_begin ../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24917:7
|
|
149
|
-
❯ commitPassiveMountEffects ../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:24905:3
|
|
150
|
-
❯ flushPassiveEffectsImpl ../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27078:3
|
|
151
|
-
|
|
152
|
-
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/8]⎯
|
|
153
|
-
|
|
154
|
-
FAIL tests/useStore.test.tsx > useStore > returns updated state after setState called
|
|
155
|
-
Error: expect(element).toHaveTextContent()
|
|
156
|
-
|
|
157
|
-
Expected element to have text content:
|
|
158
|
-
1
|
|
159
|
-
Received:
|
|
160
|
-
0
|
|
161
|
-
❯ tests/useStore.test.tsx:39:45
|
|
162
|
-
37| store.setState({ count: 1 })
|
|
163
|
-
38| })
|
|
164
|
-
39| expect(screen.getByTestId('count')).toHaveTextContent('1')
|
|
165
|
-
| ^
|
|
166
|
-
40| })
|
|
167
|
-
41|
|
|
168
|
-
|
|
169
|
-
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/8]⎯
|
|
170
|
-
|
|
171
|
-
FAIL tests/useStore.test.tsx > useStore > component re-renders when state changes
|
|
172
|
-
AssertionError: expected "spy" to be called 2 times, but got 1 times
|
|
173
|
-
❯ tests/useStore.test.tsx:55:27
|
|
174
|
-
53| store.setState({ count: 1 })
|
|
175
|
-
54| })
|
|
176
|
-
55| expect(renderSpy).toHaveBeenCalledTimes(2)
|
|
177
|
-
| ^
|
|
178
|
-
56| })
|
|
179
|
-
57|
|
|
180
|
-
|
|
181
|
-
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/8]⎯
|
|
182
|
-
|
|
183
|
-
FAIL tests/useStore.test.tsx > useStore > component does NOT re-render when unrelated state changes
|
|
184
|
-
AssertionError: expected "spy" to be called 2 times, but got 1 times
|
|
185
|
-
❯ tests/useStore.test.tsx:76:27
|
|
186
|
-
74| store.setState({ b: 3 })
|
|
187
|
-
75| })
|
|
188
|
-
76| expect(renderSpy).toHaveBeenCalledTimes(2)
|
|
189
|
-
| ^
|
|
190
|
-
77| })
|
|
191
|
-
78|
|
|
192
|
-
|
|
193
|
-
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/8]⎯
|
|
194
|
-
|
|
195
|
-
FAIL tests/useStore.test.tsx > useStore > multiple components using same store all update correctly
|
|
196
|
-
Error: expect(element).toHaveTextContent()
|
|
197
|
-
|
|
198
|
-
Expected element to have text content:
|
|
199
|
-
5
|
|
200
|
-
Received:
|
|
201
|
-
0
|
|
202
|
-
❯ tests/useStore.test.tsx:95:29
|
|
203
|
-
93| })
|
|
204
|
-
94| const elements = screen.getAllByTestId('count')
|
|
205
|
-
95| expect(elements[0]).toHaveTextContent('5')
|
|
206
|
-
| ^
|
|
207
|
-
96| expect(elements[1]).toHaveTextContent('5')
|
|
208
|
-
97| })
|
|
209
|
-
|
|
210
|
-
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/8]⎯
|
|
211
|
-
|
|
212
|
-
FAIL tests/useStore.test.tsx > useStore > multiple components using different stores are independent
|
|
213
|
-
Error: expect(element).toHaveTextContent()
|
|
214
|
-
|
|
215
|
-
Expected element to have text content:
|
|
216
|
-
10
|
|
217
|
-
Received:
|
|
218
|
-
1
|
|
219
|
-
❯ tests/useStore.test.tsx:119:41
|
|
220
|
-
117| store1.setState({ a: 10 })
|
|
221
|
-
118| })
|
|
222
|
-
119| expect(screen.getByTestId('a')).toHaveTextContent('10')
|
|
223
|
-
| ^
|
|
224
|
-
120| expect(screen.getByTestId('b')).toHaveTextContent('2')
|
|
225
|
-
121| })
|
|
226
|
-
|
|
227
|
-
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/8]⎯
|
|
228
|
-
|
|
229
|
-
Test Files 3 failed | 2 passed (5)
|
|
230
|
-
Tests 8 failed | 41 passed (49)
|
|
231
|
-
Start at 18:08:59
|
|
232
|
-
Duration 1.01s (transform 67ms, setup 133ms, collect 70ms, tests 153ms, environment 342ms, prepare 50ms)
|
|
233
|
-
|
|
234
|
-
ELIFECYCLE Test failed. See above for more details.
|