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

Mocha's done() invoked with non-Error #74

Open
stevenvachon opened this issue Apr 9, 2014 · 7 comments
Open

Mocha's done() invoked with non-Error #74

stevenvachon opened this issue Apr 9, 2014 · 7 comments
Labels

Comments

@stevenvachon
Copy link

F("something").exists(done);

throws an error. Must we really do this instead?:

F("something").exists( function(){ done() } );
@stevenvachon stevenvachon changed the title done() called with non-Object in Mocha Mocha's done() called with non-Object Apr 9, 2014
@stevenvachon stevenvachon changed the title Mocha's done() called with non-Object Mocha's done() invoked with non-Error Apr 9, 2014
@daffl
Copy link
Contributor

daffl commented Apr 9, 2014

The easiest way is probably adding it to the chain individually:

F('something').exists('Something exists');
F(done);

@daffl daffl closed this as completed Apr 9, 2014
@stevenvachon
Copy link
Author

hmm, that looks kind of confusing, though

@daffl
Copy link
Contributor

daffl commented Apr 9, 2014

Well you could also

F('something').exists('Something exists').then(done);

What data is the F("something").exists(done); callback getting?

@stevenvachon
Copy link
Author

It's a Mocha error with FuncUnit's argument data:

[Log] [ (func.js, line 14)
Object[1]
0: something
context: html
frame: Object
length: 1
prevObject: Object[1]
selector: "something"
__proto__: Object[0]
]

The same issue occurs with F("something").exists().then(done).

@daffl
Copy link
Contributor

daffl commented Apr 9, 2014

Maybe we can have @alexisabril look into this.

@daffl daffl reopened this Apr 9, 2014
@stevenvachon
Copy link
Author

It's possible that it's an issue in Mocha. I've opened this: mochajs/mocha#1187

@daffl
Copy link
Contributor

daffl commented Apr 9, 2014

I don't think it is. If you call it with done(something) and something is not falsy the first argument of a callback will count as an error (just like any other Node callback).

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

3 participants