diff --git a/tests/query.test.js b/tests/query.test.js index 536481e..80e90f4 100644 --- a/tests/query.test.js +++ b/tests/query.test.js @@ -115,32 +115,32 @@ describe('query', () => { const [edge] = relate(world, player, Damaged, enemy) update(Damaged, { damage: 10 }, edge) - // assert.deepEqual( - // query('MATCH (e, h:Health) WHERE h.current < 30 RETURN e, h.max', engine).unwrap(), - // [{ e: 12, h: { max: 50 } }] - // ) + assert.deepEqual( + query('MATCH (e, h:Health) WHERE h.current < 30 RETURN e, h.max', engine).unwrap(), + [{ e: 12, h: { max: 50 } }] + ) - // assert.deepEqual( - // query('MATCH (e, h:Health) WHERE e = 13 AND h.max = 50 OR h.current < 25 RETURN e, h.max', engine).unwrap(), - // [{ e: 13, h: { max: 50 } }] - // ) + assert.deepEqual( + query('MATCH (e, h:Health) WHERE e = 13 AND h.max = 50 OR h.current < 25 RETURN e, h.max', engine).unwrap(), + [{ e: 13, h: { max: 50 } }] + ) - // assert.deepEqual( - // query('MATCH (e, h:Health) WHERE h.max = 50 OR h.current > 45 RETURN e, h.max AS maxHealth', engine).unwrap(), - // [ - // { e: 12, maxHealth: 50 }, - // { e: 13, maxHealth: 50 } - // ] - // ) - // assert.deepEqual( - // query('MATCH (e, :Player, h:Health) WHERE (h.max = 50 OR h.current > 45) AND e = 12 RETURN e, h.max AS maxHealth', engine).unwrap(), - // [{ e: 12, maxHealth: 50 }] - // ) + assert.deepEqual( + query('MATCH (e, h:Health) WHERE h.max = 50 OR h.current > 45 RETURN e, h.max AS maxHealth', engine).unwrap(), + [ + { e: 12, maxHealth: 50 }, + { e: 13, maxHealth: 50 } + ] + ) + assert.deepEqual( + query('MATCH (e, :Player, h:Health) WHERE (h.max = 50 OR h.current > 45) AND e = 12 RETURN e, h.max AS maxHealth', engine).unwrap(), + [{ e: 12, maxHealth: 50 }] + ) - // assert.deepEqual( - // query('MATCH (:Player)-[d:Damaged]->(h:Health) RETURN h.current AS health, d.damage AS damage', engine).unwrap(), - // [{ damage: 10, health: 35 }] - // ) + assert.deepEqual( + query('MATCH (:Player)-[d:Damaged]->(h:Health) RETURN h.current AS health, d.damage AS damage', engine).unwrap(), + [{ damage: 10, health: 35 }] + ) update(Damaged, { damage: 50 }, edge) assert.deepEqual(