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

expect(object).toHaveUndefined('memberName'); #37

Closed
JamieMason opened this issue Jun 29, 2015 · 2 comments
Closed

expect(object).toHaveUndefined('memberName'); #37

JamieMason opened this issue Jun 29, 2015 · 2 comments

Comments

@JamieMason
Copy link
Owner

Use case is in ui-router state params for example, where you might want to assert that a state of a given name exists as part of the state's configuration, but that no default value has been assigned to it.

Current spec

it('should not set a default value for the dateFrom param', function() {
    expect($state.params).toHaveMember('dateFrom');
    expect($state.params.dateFrom).toBeUndefined();
});

Current output

Expected member "dateFrom" of Object({  }) to be member.
Expected undefined not to be undefined

Preferred spec

it('should not set a default value for the dateFrom param', function() {
    expect($state.params).toHaveUndefined('dateFrom');
});

Preferred output

Expected Object({  }) to have undefined member "dateFrom".
@PaulTondeur
Copy link

I would like to up-vote this request.

@jacobwardio
Copy link
Contributor

PR at #69

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

No branches or pull requests

3 participants