Add test for Y.Array.from
This commit is contained in:
		
							parent
							
								
									f215866429
								
							
						
					
					
						commit
						d29de75f85
					
				@ -32,6 +32,17 @@ export const testSlice = tc => {
 | 
				
			|||||||
  t.compareArrays(arr.slice(0, 2), [0, 1])
 | 
					  t.compareArrays(arr.slice(0, 2), [0, 1])
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @param {t.TestCase} tc
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const testArrayFrom = tc => {
 | 
				
			||||||
 | 
					  const doc1 = new Y.Doc()
 | 
				
			||||||
 | 
					  const db1 = doc1.getMap('root')
 | 
				
			||||||
 | 
					  const nestedArray1 = Y.Array.from([0, 1, 2])
 | 
				
			||||||
 | 
					  db1.set('array', nestedArray1)
 | 
				
			||||||
 | 
					  t.compare(nestedArray1.toArray(), [0, 1, 2])
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Debugging yjs#297 - a critical bug connected to the search-marker approach
 | 
					 * Debugging yjs#297 - a critical bug connected to the search-marker approach
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user