diff --git a/lib-new/Transaction.coffee b/lib-new/Transaction.coffee index bcab330..02fa6fc 100644 --- a/lib-new/Transaction.coffee +++ b/lib-new/Transaction.coffee @@ -21,6 +21,11 @@ module.exports = class Transaction # Convenience helper for nice getter syntax: # (NOTE: This does *not* support sibling setters, as we don't need it, # but it's possible to add support.) + # + # NOTE: CoffeeLint thinks this fat arrow is unnecessary here, but it's not: + # https://github.com/clutchski/coffeelint/issues/555 + # coffeelint: disable=no_private_function_fat_arrows + # get = (props) => for name, getter of props Object.defineProperty @::, name, diff --git a/test-new/transactions._coffee b/test-new/transactions._coffee index 320ed07..ed9b2e5 100644 --- a/test-new/transactions._coffee +++ b/test-new/transactions._coffee @@ -128,6 +128,9 @@ describe 'Transactions', -> {labels, properties} = fixtures.createTestNode module, _ + # Add a random property so it's easier to look for it below: + properties.test = "should isolate effects #{helpers.getRandomStr()}" + [{node}] = tx.cypher query: """ CREATE (node:#{TEST_LABEL} {properties}) @@ -145,22 +148,12 @@ describe 'Transactions', -> results = DB.cypher query: """ MATCH (node:#{TEST_LABEL}) - WHERE #{( - # NOTE: Cypher doesn’t support directly comparing nodes and - # property bags, so we have to compare each property. - # HACK: CoffeeLint thinks the below is bad indentation. - # https://github.com/clutchski/coffeelint/issues/456 - # coffeelint: disable=indentation - for prop of properties - "node.#{prop} = {properties}.#{prop}" - # coffeelint: enable=indentation - # HACK: CoffeeLint also thinks the below is double quotes! - # https://github.com/clutchski/coffeelint/issues/368 - # coffeelint: disable=no_unnecessary_double_quotes - ).join ' AND '} + // NOTE: Cypher doesn't support comparing a node or relationship + // to an entire map of properties, so we check just the one + // random one we created above: + WHERE node.test = {properties}.test RETURN node """ - # coffeelint: enable=no_unnecessary_double_quotes params: {properties} , _