MCPcopy
hub / github.com/yjs/yjs / testInsertAndDeleteEvents

Function testInsertAndDeleteEvents

tests/y-array.tests.js:262–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260 * @param {t.TestCase} tc
261 */
262export const testInsertAndDeleteEvents = tc => {
263 const { array0, users } = init(tc, { users: 2 })
264 /**
265 * @type {Object<string,any>?}
266 */
267 let event = null
268 array0.observe(e => {
269 event = e
270 })
271 array0.insert(0, [0, 1, 2])
272 t.assert(event !== null)
273 event = null
274 array0.delete(0)
275 t.assert(event !== null)
276 event = null
277 array0.delete(0, 2)
278 t.assert(event !== null)
279 event = null
280 compare(users)
281}
282
283/**
284 * @param {t.TestCase} tc

Callers

nothing calls this directly

Calls 5

initFunction · 0.90
compareFunction · 0.90
observeMethod · 0.80
insertMethod · 0.80
deleteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…