Skip to content

Callback function not working when running with mocha/chai #208

@bobbwhy

Description

@bobbwhy

I tried a sample code piece, executing in the same file as my mocha/chai calls, but placed before the describe/it sequences in mocha. That returned a console.log that places as the first line in the callback. But the pieces that were nested within mocha commands would not show the console.log statements from the callback.

I am using node 6.2 and Neo4j 3.0.4.

sample code is below... mostly lifted straight off example page.

thanks.


db.cypher({
                    query: 'MATCH (u:User {email: {email}}) RETURN u',
                    params: {
                    email: '[email protected]', 
                    },
                    }, 
                    (err, results)=> {
                        console.log(' the only')
                        log.info(' my thought')
                    if (err) throw err;
                    var result = results[0];
                    if (!result) {
                        console.log('No user found.');
                    } else {
                        var user = result['u'];
                        console.log(JSON.stringify(user, null, 4));
                    }
                    }
                );

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions