Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bobbwhy opened this issue Aug 22, 2016 · 2 comments
Open

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

bobbwhy opened this issue Aug 22, 2016 · 2 comments
Labels
Milestone

Comments

@bobbwhy
Copy link

bobbwhy commented Aug 22, 2016

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));
                    }
                    }
                );
@aseemk
Copy link
Member

aseemk commented Aug 23, 2016

Hmm, that's surprising. Would you be open to pasting your whole Mocha test file?

@aseemk aseemk added this to the v2 redesign milestone Aug 23, 2016
@bobbwhy
Copy link
Author

bobbwhy commented Aug 23, 2016

thanks so much for the quick reply. I have gone through multiple iterations with that file and I think I was simply not handling the async work correctly.

I will make another run at this on my own later tonight or tomorrow am and let you know if I still have the issue.

thanks for putting together this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants