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

Result of expression 'thisApi.assert' [undefined] is not an object #5

Closed
edelabar opened this issue Mar 29, 2011 · 4 comments
Closed

Comments

@edelabar
Copy link
Contributor

Haven't quite tracked this all the way down, but I'm working on it, from what I can tell if you specify a feature without a test function before a given and without another feature without a test function after the given, it will produce an error something like this:

Died on test #1: Result of expression 'thisApi.assert' [undefined] is not an object. - { 
"message": "Result of expression 'thisApi.assert' [undefined] is not an object.", "line": 344, 
"sourceId": 5279531008, "sourceURL": "file:///Users/ericdelabar/Documents/Code/git-
repos/pavlov/pavlov.js", "expressionBeginOffset": 11237, "expressionCaretOffset": 11251, 
"expressionEndOffset": 11256, "name": "TypeError" }

Since that sounds very confusing, see line 19:

https://github.com/edelabar/pavlov/blob/8dea6ddb3cb5025ea6c440da53b1410480eb9e27/example/example.specs.js

If you move the code on line 19 to line 44 (after the final given) it works as expected. I'm going to try and tackle this one myself, so hopefully expect a pull request in a day or so...

I'm trying to tackle this one myself but I figured I'd post it in case anybody else is seeing the problem.

@edelabar
Copy link
Contributor Author

Actually, it just seems a given can't be last, if I add a feature definition with a test function on line 44 it also works as expected...

@mmonteleone
Copy link
Owner

It also doesn't occur if the api is injected globally with

QUnit.specify.globalApi = true;

Investigating..

@edelabar
Copy link
Contributor Author

I think I got it...

#6

@mmonteleone
Copy link
Owner

I merged your request, and then also made a minor tweak to get rid of all the 'thisApi' references in the first place, since 'api' is already defined. Thanks for identifying this!

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

No branches or pull requests

2 participants