MCPcopy Index your code
hub / github.com/yjs/yjs / testFailsObjectManipulationInDevMode

Function testFailsObjectManipulationInDevMode

tests/y-array.tests.js:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 * @param {t.TestCase} _tc
25 */
26export const testFailsObjectManipulationInDevMode = _tc => {
27 if (isDevMode) {
28 t.info('running in dev mode')
29 const doc = new Y.Doc()
30 const a = [1, 2, 3]
31 const b = { o: 1 }
32 doc.get('test').insert(0, [a])
33 doc.get('map').setAttr('k', b)
34 t.fails(() => {
35 a[0] = 42
36 })
37 t.fails(() => {
38 b.o = 42
39 })
40 } else {
41 t.info('not in dev mode')
42 }
43}
44
45/**
46 * @param {t.TestCase} _tc

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
insertMethod · 0.80
setAttrMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…