@@ -2361,43 +2361,6 @@ describe("`requiresObservable` takes precedence over global `reactionRequiresObs
2361
2361
} )
2362
2362
} )
2363
2363
2364
- test ( "state version updates correctly" , ( ) => {
2365
- // This test was designed around the idea of updating version only at the end of batch,
2366
- // which is NOT an implementation we've settled on, but the test is still valid.
2367
-
2368
- // This test demonstrates that the version is correctly updated with each state mutations:
2369
- // 1. Even without wrapping mutation in batch explicitely.
2370
- // 2. Even in self-invoking recursive derivation.
2371
- const o = mobx . observable ( { x : 0 } )
2372
- let prevStateVersion
2373
-
2374
- const disposeAutorun = mobx . autorun ( ( ) => {
2375
- if ( o . x === 5 ) {
2376
- disposeAutorun ( )
2377
- return
2378
- }
2379
- const currentStateVersion = getGlobalState ( ) . stateVersion
2380
- expect ( prevStateVersion ) . not . toBe ( currentStateVersion )
2381
- prevStateVersion = currentStateVersion
2382
- o . x ++
2383
- } )
2384
-
2385
- // expect(o.x).toBe(4) is 1?
2386
- prevStateVersion = getGlobalState ( ) . stateVersion
2387
- o . x ++
2388
- expect ( o . x ) . toBe ( 5 )
2389
- expect ( prevStateVersion ) . not . toBe ( getGlobalState ( ) . stateVersion )
2390
- } )
2391
-
2392
- test ( "Atom.reportChanged does not change state version when called from the batch the atom was created in" , ( ) => {
2393
- mobx . transaction ( ( ) => {
2394
- const prevStateVersion = getGlobalState ( ) . stateVersion
2395
- const atom = mobx . createAtom ( )
2396
- atom . reportChanged ( )
2397
- expect ( prevStateVersion ) . toBe ( getGlobalState ( ) . stateVersion )
2398
- } )
2399
- } )
2400
-
2401
2364
test ( 'Observables initialization does not violate `enforceActions: "always"`' , ( ) => {
2402
2365
const consoleWarnSpy = jest . spyOn ( console , "warn" ) . mockImplementation ( ( ) => { } )
2403
2366
0 commit comments