@@ -7,9 +7,6 @@ import {ObjectType, getObjectById} from '../main/id.ts'
77import { encodeValue } from './serialize.ts'
88import { type EncodedValue , INFINITY , NAN , NEGATIVE_INFINITY , UNDEFINED , ValueType } from './types.ts'
99
10- let mockLAST_ID = 0
11- vi . mock ( '../main/get-id.ts' , ( ) => ( { getNewSdtId : ( ) => '#' + mockLAST_ID ++ } ) )
12-
1310type Expectations = [ name : string , data : unknown , encoded : EncodedValue [ ] ] [ ]
1411
1512const div1 = document . createElement ( 'div' )
@@ -24,7 +21,6 @@ const [state] = createStore({a: 1, b: 2, c: 3})
2421const mutable = createMutable ( { a : 1 , b : 2 , c : 3 } )
2522
2623describe ( 'encodeValue Preview' , ( ) => {
27- mockLAST_ID = 0
2824
2925 const encodePreviewExpectations : Expectations = [
3026 [ 'Infinity' , Infinity , [ [ ValueType . Number , INFINITY ] ] ] ,
@@ -86,7 +82,6 @@ describe('encodeValue Preview', () => {
8682} )
8783
8884describe ( 'encodeValue Deep' , ( ) => {
89- mockLAST_ID = 0
9085
9186 const encodeDeepExpectations : Expectations = [
9287 [ 'Array empty' , [ ] , [ [ ValueType . Array , [ ] ] ] ] ,
@@ -163,7 +158,6 @@ describe('encodeValue Deep', () => {
163158} )
164159
165160describe ( 'save elements to a map' , ( ) => {
166- mockLAST_ID = 0
167161
168162 const elMapExpectations : Expectations = [
169163 [ 'Element div' , div1 , [ [ ValueType . Element , '#0:div' ] ] ] ,
@@ -193,7 +187,6 @@ describe('save elements to a map', () => {
193187} )
194188
195189describe ( 'encodeValue with repeated references' , ( ) => {
196- mockLAST_ID = 0
197190
198191 const one : any = { a : 1 }
199192 one . b = one
@@ -240,7 +233,6 @@ describe('encodeValue with repeated references', () => {
240233} )
241234
242235describe ( 'finding stores in values' , ( ) => {
243- mockLAST_ID = 0
244236
245237 const [ state1 ] = createStore ( { a : 1 } )
246238 const [ state2 ] = createStore ( { ref : state1 } )
0 commit comments